semantic

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer struct {
	// contains filtered or unexported fields
}

func NewAnalyzer

func NewAnalyzer(client *Client, enableVision bool, maxFileSize int64) *Analyzer

func (*Analyzer) Analyze

func (a *Analyzer) Analyze(metadata *types.FileMetadata) (*types.SemanticAnalysis, error)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apiKey, model string, maxTokens, timeoutSeconds int) *Client

func (*Client) SendMessage

func (c *Client) SendMessage(prompt string) (string, error)

func (*Client) SendMessageWithDocument

func (c *Client) SendMessageWithDocument(prompt, documentBase64, mediaType string) (string, error)

func (*Client) SendMessageWithImage

func (c *Client) SendMessageWithImage(prompt, imageBase64, mediaType string) (string, error)

type DocumentContent

type DocumentContent struct {
	Type   string         `json:"type"`
	Source DocumentSource `json:"source"`
}

type DocumentSource

type DocumentSource struct {
	Type      string `json:"type"`
	MediaType string `json:"media_type"`
	Data      string `json:"data"` // base64 encoded
}

type ImageContent

type ImageContent struct {
	Type   string      `json:"type"`
	Source ImageSource `json:"source"`
}

type ImageSource

type ImageSource struct {
	Type      string `json:"type"`
	MediaType string `json:"media_type"`
	Data      string `json:"data"` // base64 encoded
}

type Message

type Message struct {
	Role    string `json:"role"`
	Content []any  `json:"content"`
}

type Request

type Request struct {
	Model     string    `json:"model"`
	MaxTokens int       `json:"max_tokens"`
	Messages  []Message `json:"messages"`
}

type Response

type Response struct {
	ID      string `json:"id"`
	Type    string `json:"type"`
	Role    string `json:"role"`
	Content []struct {
		Type string `json:"type"`
		Text string `json:"text"`
	} `json:"content"`
	Model string `json:"model"`
	Usage struct {
		InputTokens  int `json:"input_tokens"`
		OutputTokens int `json:"output_tokens"`
	} `json:"usage"`
}

type TextContent

type TextContent struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

Jump to

Keyboard shortcuts

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