Documentation
¶
Overview ¶
fixtures 中的 Agent 测试数据工厂。
提供预置 Agent 配置、状态与消息样例。
fixtures 中的 LLM 响应测试数据工厂。
提供常见响应、流式片段与错误场景样例。
Index ¶
- func AssistantMessage(content string) types.Message
- func AssistantMessageWithToolCalls(content string, toolCalls []types.ToolCall) types.Message
- func CalculationResponse(result string) *llm.ChatResponse
- func CalculatorToolCall(id string, a, b float64, op string) types.ToolCall
- func CalculatorToolSchema() types.ToolSchema
- func ClarificationResponse(question string) *llm.ChatResponse
- func ContentFilteredResponse() *llm.ChatResponse
- func ConversationWithToolCalls() []types.Message
- func CustomUsage(prompt, completion int) llm.ChatUsage
- func DefaultAgentConfig() types.AgentConfig
- func DefaultToolSet() []types.ToolSchema
- func ErrorChunk(err *types.Error) llm.StreamChunk
- func ErrorExplanationResponse(errorMsg string) *llm.ChatResponse
- func FullFeaturedConfig() types.AgentConfig
- func GreetingResponse() *llm.ChatResponse
- func HighIterationAgentConfig() types.AgentConfig
- func HighTemperatureAgentConfig() types.AgentConfig
- func LargeUsage() llm.ChatUsage
- func LongConversation(turns int) []types.Message
- func LowTemperatureAgentConfig() types.AgentConfig
- func MediumUsage() llm.ChatUsage
- func MinimalAgentConfig() types.AgentConfig
- func ReflectionEnabledConfig() types.AgentConfig
- func RefusalResponse(reason string) *llm.ChatResponse
- func ResponseWithSingleToolCall(content, toolName, toolID string, args []byte) *llm.ChatResponse
- func ResponseWithToolCalls(content string, toolCalls []types.ToolCall) *llm.ChatResponse
- func ResponseWithUsage(content string, promptTokens, completionTokens int) *llm.ChatResponse
- func SearchResultResponse(results []string) *llm.ChatResponse
- func SearchToolCall(id, query string, limit int) types.ToolCall
- func SearchToolSchema() types.ToolSchema
- func SimpleConversation() []types.Message
- func SimpleResponse(content string) *llm.ChatResponse
- func SimpleStreamChunks(content string, chunkSize int) []llm.StreamChunk
- func SmallUsage() llm.ChatUsage
- func StreamingAgentConfig() types.AgentConfig
- func SystemMessage(content string) types.Message
- func TextChunk(content string, finishReason string) llm.StreamChunk
- func ThinkingResponse(thinking, conclusion string) *llm.ChatResponse
- func ToolCallChunk(toolCall types.ToolCall, finishReason string) llm.StreamChunk
- func ToolMessage(toolCallID, content string) types.Message
- func ToolSelectionEnabledConfig() types.AgentConfig
- func TruncatedResponse(content string) *llm.ChatResponse
- func UserMessage(content string) types.Message
- func WeatherToolCall(id, location, unit string) types.ToolCall
- func WeatherToolSchema() types.ToolSchema
- func WordByWordChunks(words []string) []llm.StreamChunk
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssistantMessageWithToolCalls ¶
AssistantMessageWithToolCalls 创建带工具调用的助手消息
func CalculationResponse ¶
func CalculationResponse(result string) *llm.ChatResponse
CalculationResponse 返回计算响应
func CalculatorToolCall ¶
CalculatorToolCall 创建计算器工具调用
func CalculatorToolSchema ¶
func CalculatorToolSchema() types.ToolSchema
CalculatorToolSchema 返回计算器工具定义
func ClarificationResponse ¶
func ClarificationResponse(question string) *llm.ChatResponse
ClarificationResponse 返回澄清请求响应
func ContentFilteredResponse ¶
func ContentFilteredResponse() *llm.ChatResponse
ContentFilteredResponse 返回被内容过滤的响应
func ConversationWithToolCalls ¶
ConversationWithToolCalls 返回包含工具调用的对话历史
func CustomUsage ¶
CustomUsage 返回自定义 Token 使用
func DefaultAgentConfig ¶
func DefaultAgentConfig() types.AgentConfig
DefaultAgentConfig 返回默认的 Agent 配置
func ErrorExplanationResponse ¶
func ErrorExplanationResponse(errorMsg string) *llm.ChatResponse
ErrorExplanationResponse 返回错误解释响应
func FullFeaturedConfig ¶
func FullFeaturedConfig() types.AgentConfig
FullFeaturedConfig 返回启用所有功能的配置
func HighIterationAgentConfig ¶
func HighIterationAgentConfig() types.AgentConfig
HighIterationAgentConfig 返回高迭代次数的 Agent 配置
func HighTemperatureAgentConfig ¶
func HighTemperatureAgentConfig() types.AgentConfig
HighTemperatureAgentConfig 返回高温度(更创造性)的 Agent 配置
func LowTemperatureAgentConfig ¶
func LowTemperatureAgentConfig() types.AgentConfig
LowTemperatureAgentConfig 返回低温度(更确定性)的 Agent 配置
func MinimalAgentConfig ¶
func MinimalAgentConfig() types.AgentConfig
MinimalAgentConfig 返回最小化的 Agent 配置
func ReflectionEnabledConfig ¶
func ReflectionEnabledConfig() types.AgentConfig
ReflectionEnabledConfig 返回启用反思功能的配置
func ResponseWithSingleToolCall ¶
func ResponseWithSingleToolCall(content, toolName, toolID string, args []byte) *llm.ChatResponse
ResponseWithSingleToolCall 返回带单个工具调用的响应
func ResponseWithToolCalls ¶
func ResponseWithToolCalls(content string, toolCalls []types.ToolCall) *llm.ChatResponse
ResponseWithToolCalls 返回带工具调用的响应
func ResponseWithUsage ¶
func ResponseWithUsage(content string, promptTokens, completionTokens int) *llm.ChatResponse
ResponseWithUsage 返回带自定义 Token 使用量的响应
func SearchResultResponse ¶
func SearchResultResponse(results []string) *llm.ChatResponse
SearchResultResponse 返回搜索结果响应
func SearchToolCall ¶
SearchToolCall 创建搜索工具调用
func SimpleResponse ¶
func SimpleResponse(content string) *llm.ChatResponse
SimpleResponse 返回简单的文本响应
func SimpleStreamChunks ¶
func SimpleStreamChunks(content string, chunkSize int) []llm.StreamChunk
SimpleStreamChunks 返回简单的流式块序列
func StreamingAgentConfig ¶
func StreamingAgentConfig() types.AgentConfig
StreamingAgentConfig 返回启用流式输出的 Agent 配置
func TextChunk ¶
func TextChunk(content string, finishReason string) llm.StreamChunk
TextChunk 创建文本流式块
func ThinkingResponse ¶
func ThinkingResponse(thinking, conclusion string) *llm.ChatResponse
ThinkingResponse 返回思考过程响应
func ToolCallChunk ¶
func ToolCallChunk(toolCall types.ToolCall, finishReason string) llm.StreamChunk
ToolCallChunk 创建工具调用流式块
func ToolSelectionEnabledConfig ¶
func ToolSelectionEnabledConfig() types.AgentConfig
ToolSelectionEnabledConfig 返回启用工具选择的配置
func TruncatedResponse ¶
func TruncatedResponse(content string) *llm.ChatResponse
TruncatedResponse 返回因长度限制而截断的响应
func WeatherToolCall ¶
WeatherToolCall 创建天气工具调用
func WordByWordChunks ¶
func WordByWordChunks(words []string) []llm.StreamChunk
WordByWordChunks 返回逐词的流式块序列
Types ¶
This section is empty.