base_url 来使用 OpenAILike 模型访问它们。
示例
参数
OpenAILike 也支持 OpenAIChat 的所有参数。Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
了解如何在 Agno 中使用类似 OpenAI 的模型。
base_url 来使用 OpenAILike 模型访问它们。
from os import getenv
from agno.agent import Agent, RunResponse
from agno.models.openai.like import OpenAILike
agent = Agent(
model=OpenAILike(
id="mistralai/Mixtral-8x7B-Instruct-v0.1",
api_key=getenv("TOGETHER_API_KEY"),
base_url="https://api.together.xyz/v1",
)
)
# 在终端打印响应
agent.print_response("Share a 2 sentence horror story.")
OpenAILike 也支持 OpenAIChat 的所有参数。