package models type Question struct { ID string `json:"id"` Topic string `json:"topic"` Question string `json:"question"` } type Answer struct { Q Question Answer string `json:"answer"` Model string `json:"model"` ToolCall ToolCallInfo `json:"tool_call,omitempty"` } type ToolCallInfo struct { Name string `json:"name"` Args map[string]string `json:"args"` } // type OpenRouterResp struct { // ID string `json:"id"` // Provider string `json:"provider"` // Model string `json:"model"` // Object string `json:"object"` // Created int `json:"created"` // Choices []struct { // Logprobs any `json:"logprobs"` // FinishReason string `json:"finish_reason"` // NativeFinishReason string `json:"native_finish_reason"` // Index int `json:"index"` // Message struct { // Role string `json:"role"` // Content string `json:"content"` // Refusal any `json:"refusal"` // Reasoning any `json:"reasoning"` // } `json:"message"` // } `json:"choices"` // Usage struct { // PromptTokens int `json:"prompt_tokens"` // CompletionTokens int `json:"completion_tokens"` // TotalTokens int `json:"total_tokens"` // } `json:"usage"` // } type ToolCallFunction struct { Name string `json:"name"` Arguments string `json:"arguments"` } type ToolCall struct { ID string `json:"id"` Type string `json:"type"` Function ToolCallFunction `json:"function"` } type DSRespChoice struct { Text string `json:"text"` Index int `json:"index"` FinishReason string `json:"finish_reason"` Message struct { Role string `json:"role"` Content string `json:"content"` ToolCalls []ToolCall `json:"tool_calls,omitempty"` } `json:"message,omitempty"` } type DSResp struct { ID string `json:"id"` Choices []DSRespChoice `json:"choices"` Created int `json:"created"` Model string `json:"model"` SystemFingerprint string `json:"system_fingerprint"` Object string `json:"object"` } // OpenRouter chat completions response (supports tool calls) type ORChatRespChoice struct { Index int `json:"index"` Message struct { Role string `json:"role"` Content string `json:"content"` ToolCalls []ToolCall `json:"tool_calls,omitempty"` } `json:"message"` FinishReason string `json:"finish_reason"` } type ORChatResp struct { ID string `json:"id"` Choices []ORChatRespChoice `json:"choices"` Created int `json:"created"` Model string `json:"model"` Object string `json:"object"` Usage struct { PromptTokens int `json:"prompt_tokens"` CompletionTokens int `json:"completion_tokens"` TotalTokens int `json:"total_tokens"` } `json:"usage"` } // OpenRouter completions response (text only) type ORCompletionResp struct { ID string `json:"id"` Object string `json:"object"` Created int `json:"created"` Model string `json:"model"` Choices []struct { Text string `json:"text"` Index int `json:"index"` Logprobs any `json:"logprobs"` FinishReason string `json:"finish_reason"` } `json:"choices"` Usage struct { PromptTokens int `json:"prompt_tokens"` CompletionTokens int `json:"completion_tokens"` TotalTokens int `json:"total_tokens"` } `json:"usage"` } type LLMResp struct { Index int `json:"index"` Content string `json:"content"` Tokens []any `json:"tokens"` IDSlot int `json:"id_slot"` Stop bool `json:"stop"` Model string `json:"model"` TokensPredicted int `json:"tokens_predicted"` TokensEvaluated int `json:"tokens_evaluated"` Prompt string `json:"prompt"` HasNewLine bool `json:"has_new_line"` Truncated bool `json:"truncated"` StopType string `json:"stop_type"` StoppingWord string `json:"stopping_word"` TokensCached int `json:"tokens_cached"` } type LCPResp struct { Content string `json:"content"` } type RPScenario struct { Name string `json:"name"` CharSysPrompt string `json:"char_sys_prompt"` UserSysPrompt string `json:"user_sys_prompt"` CharName string `json:"char_name"` UserName string `json:"user_name"` FirstMsg string `json:"first_msg"` } type RPMessage struct { Author string `json:"author"` Content string `json:"content"` } // === tools models type ToolArgProps struct { Type string `json:"type"` Description string `json:"description"` } type ToolFuncParams struct { Type string `json:"type"` Properties map[string]ToolArgProps `json:"properties"` Required []string `json:"required"` } type ToolFunc struct { Name string `json:"name"` Description string `json:"description"` Parameters ToolFuncParams `json:"parameters"` } type Tool struct { Type string `json:"type"` Function ToolFunc `json:"function"` } type OpenAIReq struct { *ChatBody Tools []Tool `json:"tools"` } type ChatBody struct { Model string `json:"model"` Messages []RoleMsg `json:"messages"` } type RoleMsg struct { Role string `json:"role"` Content string `json:"content"` } // ===