httpapi

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheControl

type CacheControl = protocoltypes.CacheControl

type ContentBlock

type ContentBlock = protocoltypes.ContentBlock

type ExtraContent

type ExtraContent = protocoltypes.ExtraContent

type FunctionCall

type FunctionCall = protocoltypes.FunctionCall

type GeminiProvider

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

func NewGeminiProvider

func NewGeminiProvider(
	apiKey string,
	apiBase string,
	proxy string,
	userAgent string,
	requestTimeoutSeconds int,
	extraBody map[string]any,
	customHeaders map[string]string,
) *GeminiProvider

func (*GeminiProvider) Chat

func (p *GeminiProvider) Chat(
	ctx context.Context,
	messages []Message,
	tools []ToolDefinition,
	model string,
	options map[string]any,
) (*LLMResponse, error)

func (*GeminiProvider) ChatStream

func (p *GeminiProvider) ChatStream(
	ctx context.Context,
	messages []Message,
	tools []ToolDefinition,
	model string,
	options map[string]any,
	onChunk func(accumulated string),
) (*LLMResponse, error)

func (*GeminiProvider) GetDefaultModel

func (p *GeminiProvider) GetDefaultModel() string

func (*GeminiProvider) SupportsThinking

func (p *GeminiProvider) SupportsThinking() bool

type GoogleExtra

type GoogleExtra = protocoltypes.GoogleExtra

type HTTPProvider

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

func NewHTTPProvider

func NewHTTPProvider(apiKey, apiBase, proxy string) *HTTPProvider

func NewHTTPProviderWithMaxTokensField

func NewHTTPProviderWithMaxTokensField(apiKey, apiBase, proxy, maxTokensField string) *HTTPProvider

func NewHTTPProviderWithMaxTokensFieldAndRequestTimeout

func NewHTTPProviderWithMaxTokensFieldAndRequestTimeout(
	apiKey, apiBase, proxy, maxTokensField, userAgent string,
	requestTimeoutSeconds int,
	extraBody map[string]any,
	customHeaders map[string]string,
) *HTTPProvider

func (*HTTPProvider) Chat

func (p *HTTPProvider) Chat(
	ctx context.Context,
	messages []Message,
	tools []ToolDefinition,
	model string,
	options map[string]any,
) (*LLMResponse, error)

func (*HTTPProvider) ChatStream

func (p *HTTPProvider) ChatStream(
	ctx context.Context,
	messages []Message,
	tools []ToolDefinition,
	model string,
	options map[string]any,
	onChunk func(accumulated string),
) (*LLMResponse, error)

ChatStream implements providers.StreamingProvider by delegating to the OpenAI-compatible streaming endpoint (SSE with stream: true).

func (*HTTPProvider) GetDefaultModel

func (p *HTTPProvider) GetDefaultModel() string

func (*HTTPProvider) SupportsNativeSearch

func (p *HTTPProvider) SupportsNativeSearch() bool

type LLMProvider

type LLMProvider interface {
	Chat(
		ctx context.Context,
		messages []Message,
		tools []ToolDefinition,
		model string,
		options map[string]any,
	) (*LLMResponse, error)
	GetDefaultModel() string
}

type LLMResponse

type LLMResponse = protocoltypes.LLMResponse

type Message

type Message = protocoltypes.Message

type StreamingProvider

type StreamingProvider interface {
	ChatStream(
		ctx context.Context,
		messages []Message,
		tools []ToolDefinition,
		model string,
		options map[string]any,
		onChunk func(accumulated string),
	) (*LLMResponse, error)
}

type ToolCall

type ToolCall = protocoltypes.ToolCall

type ToolDefinition

type ToolDefinition = protocoltypes.ToolDefinition

type ToolFunctionDefinition

type ToolFunctionDefinition = protocoltypes.ToolFunctionDefinition

type UsageInfo

type UsageInfo = protocoltypes.UsageInfo

Jump to

Keyboard shortcuts

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