Documentation
¶
Index ¶
- Constants
- Variables
- func RedactDiagnostic(text string, limit int) string
- func ValidateJSONRequest(req JSONRequest) error
- type InstructionProfile
- type JSONGenerator
- type JSONRequest
- type JSONResponse
- type Message
- type NoopUsageReporter
- type OpenAICompatibleConfig
- type OpenAICompatibleJSONGenerator
- type Usage
- type UsageReporter
Constants ¶
View Source
const (
DefaultDiagnosticLimit = 4096
)
Variables ¶
View Source
var ( ErrInvalidInstructionSequence = errors.New("llm: invalid instruction sequence") ErrInvalidInstructionProfile = errors.New("llm: invalid instruction profile") )
View Source
var ( ErrNilContext = errors.New("llm: context is nil") ErrNilJSONGenerator = errors.New("llm: json generator is nil") ErrInvalidJSONRequest = errors.New("llm: invalid json request") )
View Source
var ( ErrOpenAIEmptyOutput = openaidiag.ErrEmptyOutput ErrOpenAIRefusalOutput = openaidiag.ErrRefusalOutput )
Functions ¶
func RedactDiagnostic ¶
func ValidateJSONRequest ¶
func ValidateJSONRequest(req JSONRequest) error
Types ¶
type InstructionProfile ¶ added in v1.29.0
type InstructionProfile uint8
const ( InstructionProfileOpenAI InstructionProfile = iota InstructionProfileSingleDeveloper InstructionProfileSingleSystem )
func InstructionProfileForModel ¶ added in v1.29.0
func InstructionProfileForModel(model string) InstructionProfile
type JSONGenerator ¶
type JSONGenerator interface {
GenerateJSON(ctx context.Context, req JSONRequest) (JSONResponse, error)
}
type JSONRequest ¶
type JSONResponse ¶
func RunJSON ¶
func RunJSON(ctx context.Context, generator JSONGenerator, req JSONRequest, provider string, reporter UsageReporter) (JSONResponse, error)
type Message ¶ added in v1.29.0
func AdaptInstructionMessages ¶ added in v1.29.0
func AdaptInstructionMessages(messages []Message, profile InstructionProfile) ([]Message, error)
type OpenAICompatibleConfig ¶
type OpenAICompatibleJSONGenerator ¶
type OpenAICompatibleJSONGenerator struct {
// contains filtered or unexported fields
}
func NewOpenAICompatibleJSONGenerator ¶
func NewOpenAICompatibleJSONGenerator(cfg OpenAICompatibleConfig) (*OpenAICompatibleJSONGenerator, error)
func (*OpenAICompatibleJSONGenerator) GenerateJSON ¶
func (g *OpenAICompatibleJSONGenerator) GenerateJSON(ctx context.Context, req JSONRequest) (JSONResponse, error)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
Package openaipreset는 pkg/llm의 OpenAI 호환 JSON 생성 경로를 functional-options 클라이언트로 감싼 재사용 프리셋이다.
|
Package openaipreset는 pkg/llm의 OpenAI 호환 JSON 생성 경로를 functional-options 클라이언트로 감싼 재사용 프리셋이다. |
Click to show internal directories.
Click to hide internal directories.