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: |

Your posting frequency depends on the topic of your channel. If you have a news channel, it’s OK to publish new content every day (or even every hour). For other industries, stick with 2-3 large posts a week. Today, we will address Telegram channels and how to use them for maximum benefit. 5Telegram Channel avatar size/dimensions In handing down the sentence yesterday, deputy judge Peter Hui Shiu-keung of the district court said that even if Ng did not post the messages, he cannot shirk responsibility as the owner and administrator of such a big group for allowing these messages that incite illegal behaviors to exist. Hui said the messages, which included urging the disruption of airport operations, were attempts to incite followers to make use of poisonous, corrosive or flammable substances to vandalize police vehicles, and also called on others to make weapons to harm police.
from us


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