package llm // Tool represents an OpenAI-compatible tool definition type Tool struct { Type string `json:"type"` Function FunctionDef `json:"function"` } // FunctionDef defines a function that can be called by the LLM type FunctionDef struct { Name string `json:"name"` Description string `json:"description"` Parameters Parameters `json:"parameters"` } // Parameters defines the parameters schema for a function type Parameters struct { Type string `json:"type"` Properties map[string]Property `json:"properties"` Required []string `json:"required"` } // Property defines a single parameter property type Property struct { Type string `json:"type"` Description string `json:"description"` Items *Items `json:"items,omitempty"` } // Items defines the schema for array items type Items struct { Type string `json:"type"` } // ChatRequest represents a request to the chat completions API type ChatRequest struct { Model string `json:"model"` Messages []Message `json:"messages"` Tools []Tool `json:"tools,omitempty"` ToolChoice string `json:"tool_choice,omitempty"` } // Message represents a chat message type Message struct { Role string `json:"role"` Content string `json:"content"` ToolCalls []ToolCall `json:"tool_calls,omitempty"` ToolCallID string `json:"tool_call_id,omitempty"` } // ToolCall represents a tool invocation by the LLM type ToolCall struct { ID string `json:"id"` Type string `json:"type"` Function FunctionCall `json:"function"` } // FunctionCall represents the function being called type FunctionCall struct { Name string `json:"name"` Arguments string `json:"arguments"` } // ChatResponse represents a response from the chat completions API type ChatResponse struct { Choices []Choice `json:"choices"` Error *APIError `json:"error,omitempty"` } // Choice represents a response choice type Choice struct { Message Message `json:"message"` FinishReason string `json:"finish_reason"` } // APIError represents an API error response type APIError struct { Message string `json:"message"` } // SummarizeRequest represents a request to the summarize endpoint type SummarizeRequest struct { RepoURL string `json:"repo_url,omitempty"` RepoPath string `json:"repo_path,omitempty"` Base string `json:"base"` Head string `json:"head"` Style string `json:"style,omitempty"` // "detailed" (default), "short", "bluesky" } // SummarizeResponse represents a response from the summarize endpoint type SummarizeResponse struct { Summary string `json:"summary"` Error string `json:"error,omitempty"` }