Documentation
¶
Overview ¶
Package openaipreset는 pkg/llm의 OpenAI 호환 JSON 생성 경로를 functional-options 클라이언트로 감싼 재사용 프리셋이다.
Index ¶
- func UsageFromResponseUsage(usage *responses.ResponseUsage) sharedllm.Usage
- type Client
- func (c *Client) Complete(ctx context.Context, req CompletionRequest) (CompletionResponse, error)
- func (c *Client) GenerateJSON(ctx context.Context, systemPrompt, userPrompt string, schema map[string]any) (string, error)
- func (c *Client) Model() string
- func (c *Client) RunInto(ctx context.Context, task, prompt string, schema map[string]any, out any) error
- type CompletionRequest
- type CompletionResponse
- type Message
- type Option
- func WithAllowChatCompletionsFallback(enabled bool) Option
- func WithChatCompletions() Option
- func WithHTTPClient(client *http.Client) Option
- func WithLogger(logger *slog.Logger) Option
- func WithReasoningEffort(effort string) Option
- func WithSchemaName(name string) Option
- func WithTemperature(temperature float64) Option
- func WithUsageReporter(reporter sharedllm.UsageReporter) Option
- func WithWebSearch(enabled bool) Option
- type ResponseFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UsageFromResponseUsage ¶
func UsageFromResponseUsage(usage *responses.ResponseUsage) sharedllm.Usage
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Complete ¶
func (c *Client) Complete(ctx context.Context, req CompletionRequest) (CompletionResponse, error)
func (*Client) GenerateJSON ¶
type CompletionRequest ¶
type CompletionResponse ¶
func CompletionFromResponse ¶
func CompletionFromResponse(resp *responses.Response, requestedModel string) CompletionResponse
type Option ¶
type Option func(*config)
func WithChatCompletions ¶
func WithChatCompletions() Option
func WithHTTPClient ¶
func WithLogger ¶
func WithReasoningEffort ¶
func WithSchemaName ¶
func WithTemperature ¶
func WithUsageReporter ¶
func WithUsageReporter(reporter sharedllm.UsageReporter) Option
func WithWebSearch ¶
Click to show internal directories.
Click to hide internal directories.