types

package
v0.17.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentContext

type AgentContext struct {
	WorkspaceRoot string            `json:"workspace_root"`
	CurrentFiles  []string          `json:"current_files"`
	GitStatus     string            `json:"git_status,omitempty"`
	Metadata      map[string]string `json:"metadata,omitempty"`
}

AgentContext represents context for agent operations

type AgentTokenUsage

type AgentTokenUsage struct {
	PromptTokens     int     `json:"prompt_tokens"`
	CompletionTokens int     `json:"completion_tokens"`
	TotalTokens      int     `json:"total_tokens"`
	EstimatedCost    float64 `json:"estimated_cost"`
	Model            string  `json:"model,omitempty"`
	Provider         string  `json:"provider,omitempty"`
}

AgentTokenUsage represents token usage from agent operations

type ChatResponse

type ChatResponse struct {
	ID      string   `json:"id"`
	Object  string   `json:"object"`
	Created int64    `json:"created"`
	Model   string   `json:"model"`
	Choices []Choice `json:"choices"`
	Usage   Usage    `json:"usage"`
}

ChatResponse represents a chat API response

type Choice

type Choice struct {
	Index   int `json:"index"`
	Message struct {
		Role             string         `json:"role"`
		Content          string         `json:"content"`
		ReasoningContent string         `json:"reasoning_content,omitempty"`
		Images           []ImageData    `json:"images,omitempty"`
		ToolCalls        []api.ToolCall `json:"tool_calls,omitempty"`
	} `json:"message"`
	FinishReason string `json:"finish_reason"`
}

Choice represents a response choice

type CodeReviewResult

type CodeReviewResult struct {
	Issues           []string         `json:"issues,omitempty"`
	Suggestions      []string         `json:"suggestions,omitempty"`
	Approved         bool             `json:"approved"`
	Status           string           `json:"status,omitempty"`
	Feedback         string           `json:"feedback,omitempty"`
	DetailedGuidance string           `json:"detailed_guidance,omitempty"`
	NewPrompt        string           `json:"new_prompt,omitempty"`
	PatchResolution  *PatchResolution `json:"patch_resolution,omitempty"`
}

CodeReviewResult represents the result of a code review

type EditPlan

type EditPlan struct {
	Target      string   `json:"target"`
	Changes     []string `json:"changes"`
	Rationale   string   `json:"rationale"`
	Files       []string `json:"files"`
	TestChanges bool     `json:"test_changes"`
}

EditPlan represents a plan for code edits

type ImageData

type ImageData struct {
	URL    string `json:"url,omitempty"`    // URL to image
	Base64 string `json:"base64,omitempty"` // Base64 encoded image data
	Type   string `json:"type,omitempty"`   // MIME type (image/jpeg, image/png, etc.)
}

ImageData represents an image in a message

type IntentAnalysis

type IntentAnalysis struct {
	Intent       string            `json:"intent"`
	Actions      []string          `json:"actions"`
	Files        []string          `json:"files"`
	Confidence   float64           `json:"confidence"`
	Dependencies map[string]string `json:"dependencies,omitempty"`
}

IntentAnalysis represents the analysis of user intent

type Message

type Message struct {
	Role             string      `json:"role"`
	Content          string      `json:"content"`
	ReasoningContent string      `json:"reasoning_content,omitempty"`
	Images           []ImageData `json:"images,omitempty"` // Support for multiple images
}

Message represents a chat message

type ModelInfo

type ModelInfo struct {
	ID              string  `json:"id"`
	Name            string  `json:"name"`
	Provider        string  `json:"provider"`
	Description     string  `json:"description,omitempty"`
	ContextLength   int     `json:"context_length,omitempty"`
	InputCost       float64 `json:"input_cost,omitempty"`
	OutputCost      float64 `json:"output_cost,omitempty"`
	CachedInputCost float64 `json:"cached_input_cost,omitempty"`
	Cost            float64 `json:"cost,omitempty"`
}

ModelInfo represents information about a model

type ModelPricing

type ModelPricing struct {
	InputCost       float64 `json:"input_cost"`
	OutputCost      float64 `json:"output_cost"`
	InputCostPer1K  float64 `json:"input_cost_per_1k"`  // Alias for compatibility
	OutputCostPer1K float64 `json:"output_cost_per_1k"` // Alias for compatibility
}

ModelPricing represents cost per 1K tokens for different models

type PatchResolution

type PatchResolution struct {
	ApprovedChanges []string          `json:"approved_changes,omitempty"`
	RejectedChanges []string          `json:"rejected_changes,omitempty"`
	Comments        []string          `json:"comments,omitempty"`
	Status          string            `json:"status,omitempty"`
	SingleFile      string            `json:"SingleFile"`
	MultiFile       map[string]string `json:"MultiFile"`
}

PatchResolution represents the resolution of a patch/diff

func (*PatchResolution) IsEmpty

func (pr *PatchResolution) IsEmpty() bool

IsEmpty checks if the patch resolution is empty

func (*PatchResolution) MarshalJSON

func (pr *PatchResolution) MarshalJSON() ([]byte, error)

MarshalJSON implements custom JSON marshaling for PatchResolution

func (*PatchResolution) UnmarshalJSON

func (pr *PatchResolution) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom JSON unmarshaling for PatchResolution It can handle both string format (single file) and object format (multi-file)

type PricingTable

type PricingTable struct {
	Models map[string]ModelPricing `json:"models"`
}

PricingTable holds per-model pricing that can be loaded from disk

type TokenUsage

type TokenUsage = Usage

TokenUsage represents token usage from LLM responses (alias for Usage)

type ToolCallFunction

type ToolCallFunction struct {
	Name      string `json:"name"`
	Arguments string `json:"arguments"`
}

ToolCallFunction represents the function part of a tool call

type Usage

type Usage struct {
	PromptTokens        int     `json:"prompt_tokens"`
	CompletionTokens    int     `json:"completion_tokens"`
	TotalTokens         int     `json:"total_tokens"`
	EstimatedCost       float64 `json:"estimated_cost"`
	Estimated           bool    `json:"estimated,omitempty"`
	PromptTokensDetails struct {
		CachedTokens     int  `json:"cached_tokens"`
		CacheWriteTokens *int `json:"cache_write_tokens"`
	} `json:"prompt_tokens_details,omitempty"`
}

Usage represents token usage information

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL