Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientBuilder ¶
type ClientBuilder interface {
Init(config core.Config) ClientBuilder
Temperature(temp float64) ClientBuilder
Model(model string) ClientBuilder
MaxTokens(max int) ClientBuilder
Stop(stop ...string) ClientBuilder
TopP(top float64) ClientBuilder
EnableThinking(think bool) ClientBuilder
ThinkingBudget(budget int) ClientBuilder
EnableSearch(search bool) ClientBuilder
IncrementalOutput(enabled bool) ClientBuilder // 流式增量输出(DeepSeek, Qwen)
Format(format string) ClientBuilder // 响应格式,如 "json"(Ollama)
KeepAlive(duration string) ClientBuilder // 模型内存保持时长(Ollama)
UsageCallback(fn func(core.Usage)) ClientBuilder
Attach(attachments ...core.Attachment) ClientBuilder
UserMessage(msg string) ClientBuilder
SysemMessage(msg string) ClientBuilder
AssistantMessage(msg string) ClientBuilder
Tools(tool ...core.Tool) ClientBuilder
GetResponse(clientType ClientType) (*core.Response, error)
GetStream(clientType ClientType) (*core.Stream, error)
Build() (core.Client, error) // 构建并返回客户端(openai)
BuildFor(clientType ClientType) (core.Client, error)
}
type ClientType ¶
type ClientType int
const ( OpenAIClient ClientType = iota AnthropicClient DeepSeekClient AzureClient OllamaClient QwenClient // 阿里云通义千问(使用 DashScope API) )
Directories
¶
| Path | Synopsis |
|---|---|
|
client
|
|
|
examples
|
|
|
01_basic_chat
command
Basic example demonstrating simple chat completion with OpenAI.
|
Basic example demonstrating simple chat completion with OpenAI. |
|
02_multi_turn
command
Multi-turn conversation example.
|
Multi-turn conversation example. |
|
03_streaming
command
Streaming response example.
|
Streaming response example. |
|
04_tool_calling
command
Tool calling example.
|
Tool calling example. |
|
05_multiple_providers
command
Multiple providers example.
|
Multiple providers example. |
|
06_image_input
command
Multimodal input example - sending images to the model.
|
Multimodal input example - sending images to the model. |
|
07_document_analysis
command
Document analysis example - analyzing PDF, text files, or other documents.
|
Document analysis example - analyzing PDF, text files, or other documents. |
|
08_multiple_images
command
Multiple images example - analyzing multiple images in one request.
|
Multiple images example - analyzing multiple images in one request. |
|
09_helper_utilities
command
Helper utilities for common use cases.
|
Helper utilities for common use cases. |
|
10_integration_test
command
|
|
Click to show internal directories.
Click to hide internal directories.