CohereLLM¶
使用异步客户端进行并发文本生成的 Cohere API 实现。
属性¶
-
model: 要用于生成的 Cohere API 中的模型名称。
-
base_url: 用于 Cohere API 请求的基础 URL。默认为
"https://api.cohere.ai/v1"
。 -
api_key: 用于验证对 Cohere API 请求的 API 密钥。默认为
COHERE_API_KEY
环境变量的值。 -
timeout: 等待 API 响应的最长时间(秒)。默认为
120
。 -
client_name: 用于 API 请求的客户端名称。默认为
"distilabel"
。 -
structured_output: 一个字典,包含使用
instructor
的结构化输出配置。您可以查看distilabel.steps.tasks.structured_outputs.instructor
中的InstructorStructuredOutputType
的字典结构。 -
_ChatMessage: 来自
cohere
包的ChatMessage
类。 -
_aclient: 来自
cohere
包的AsyncClient
客户端。
运行时参数¶
-
base_url: 用于 Cohere API 请求的基础 URL。默认为
"https://api.cohere.ai/v1"
。 -
api_key: 用于验证对 Cohere API 请求的 API 密钥。默认为
COHERE_API_KEY
环境变量的值。 -
timeout: 等待 API 响应的最长时间(秒)。默认为
120
。 -
client_name: 用于 API 请求的客户端名称。默认为
"distilabel"
。