MOBILEPROGLIB Telegram 6517
⚙️ AnyLanguageModel — совместимая по API замена Foundation Models на кастомные модели

AnyLanguageModel — пакет Swift, предоставляющий готовую замену фреймворку Apple Foundation Models с поддержкой кастомных моделей. Всё, что вам нужно сделать, — это изменить оператор импорта:

— import FoundationModels
+ import AnyLanguageModel

struct WeatherTool: Tool {
let name = "getWeather"
let description = "Retrieve the latest weather information for a city"

@Generable
struct Arguments {
@Guide(description: "The city to fetch the weather for")
var city: String
}

func call(arguments: Arguments) async throws -> String {
"The weather in \(arguments.city) is sunny and 72°F / 23°C"
}
}

let model = SystemLanguageModel.default
let session = LanguageModelSession(model: model, tools: [WeatherTool()])

let response = try await session.respond {
Prompt("How's the weather in Cupertino?")
}
print(response.content)


Поддерживаемые провайдеры:

• Apple Foundation Models
• Core ML models
• MLX models
• llama.cpp (GGUF models)
• Ollama HTTP API
• Anthropic Messages API
• Google Gemini API
• OpenAI Chat Completions API

💻 AnyLanguageModel на GitHub

🔸 Курс «Специалист по ИИ»
🔸 Получить консультацию менеджера
🔸 Сайт Академии 🔸 Сайт Proglib

🐸 Библиотека мобильного разработчика

#буст #iOS
Please open Telegram to view this post
VIEW IN TELEGRAM



tgoop.com/mobileproglib/6517
Create:
Last Update:

⚙️ AnyLanguageModel — совместимая по API замена Foundation Models на кастомные модели

AnyLanguageModel — пакет Swift, предоставляющий готовую замену фреймворку Apple Foundation Models с поддержкой кастомных моделей. Всё, что вам нужно сделать, — это изменить оператор импорта:

— import FoundationModels
+ import AnyLanguageModel

struct WeatherTool: Tool {
let name = "getWeather"
let description = "Retrieve the latest weather information for a city"

@Generable
struct Arguments {
@Guide(description: "The city to fetch the weather for")
var city: String
}

func call(arguments: Arguments) async throws -> String {
"The weather in \(arguments.city) is sunny and 72°F / 23°C"
}
}

let model = SystemLanguageModel.default
let session = LanguageModelSession(model: model, tools: [WeatherTool()])

let response = try await session.respond {
Prompt("How's the weather in Cupertino?")
}
print(response.content)


Поддерживаемые провайдеры:

• Apple Foundation Models
• Core ML models
• MLX models
• llama.cpp (GGUF models)
• Ollama HTTP API
• Anthropic Messages API
• Google Gemini API
• OpenAI Chat Completions API

💻 AnyLanguageModel на GitHub

🔸 Курс «Специалист по ИИ»
🔸 Получить консультацию менеджера
🔸 Сайт Академии 🔸 Сайт Proglib

🐸 Библиотека мобильного разработчика

#буст #iOS

BY Библиотека мобильного разработчика | Android, iOS, Swift, Retrofit, Moshi, Chuck




Share with your friend now:
tgoop.com/mobileproglib/6517

View MORE
Open in Telegram


Telegram News

Date: |

Public channels are public to the internet, regardless of whether or not they are subscribed. A public channel is displayed in search results and has a short address (link). Choose quality over quantity. Remember that one high-quality post is better than five short publications of questionable value. A Telegram channel is used for various purposes, from sharing helpful content to implementing a business strategy. In addition, you can use your channel to build and improve your company image, boost your sales, make profits, enhance customer loyalty, and more. 3How to create a Telegram channel? The creator of the channel becomes its administrator by default. If you need help managing your channel, you can add more administrators from your subscriber base. You can provide each admin with limited or full rights to manage the channel. For example, you can allow an administrator to publish and edit content while withholding the right to add new subscribers.
from us


Telegram Библиотека мобильного разработчика | Android, iOS, Swift, Retrofit, Moshi, Chuck
FROM American