Documentation ¶
Index ¶
- func Create(id, name string, v *Config, workers map[eosc.RequireId]eosc.IWorker) (eosc.IWorker, error)
- func NewFactory() eosc.IExtenderDriverFactory
- func Register(register eosc.IExtenderDriverRegister)
- type Chat
- type ClientRequest
- type CompletionTokensDetails
- type Config
- type Converter
- type Error
- type IModelMode
- type Message
- type ModelConfig
- type Response
- type ResponseChoice
- type Usage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Chat ¶
type Chat struct {
// contains filtered or unexported fields
}
func (*Chat) RequestConvert ¶
type ClientRequest ¶
type ClientRequest struct {
Messages []*Message `json:"messages"`
}
* 返回正确示例
{ "id": "chatcmpl-d615c27e-8f08-44f4-a0f1-241f4cb5731e", "object": "chat.completion", "created": 1735527988, "model": "llama3-8b-8192", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "response content!" }, "logprobs": null, "finish_reason": "stop" } ], "usage": { "queue_time": 0.017568127, "prompt_tokens": 18, "prompt_time": 0.00188563, "completion_tokens": 638, "completion_time": 0.531666667, "total_tokens": 656, "total_time": 0.533552297 }, "system_fingerprint": "fp_179b0f92c9", "x_groq": { "id": "req_01jgarez1gea59fnyaxeq8m463" } }
返回失败示例
{ "error": { "message": "'messages.0' : discriminator property 'role' has invalid value", "type": "invalid_request_error" } }
type CompletionTokensDetails ¶
type CompletionTokensDetails struct {
ReasoningTokens int `json:"reasoning_tokens"`
}
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
func (*Converter) RequestConvert ¶
type IModelMode ¶
type IModelMode interface { Endpoint() string convert.IConverter }
type ModelConfig ¶
type ResponseChoice ¶
Click to show internal directories.
Click to hide internal directories.