instructor

package
v0.0.0-...-db2cc6c Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2025 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ModeToolCall       = core.ModeToolCall
	ModeToolCallStrict = core.ModeToolCallStrict
	ModeJSON           = core.ModeJSON
	ModeJSONStrict     = core.ModeJSONStrict
	ModeJSONSchema     = core.ModeJSONSchema
	ModeMarkdownJSON   = core.ModeMarkdownJSON
	ModeDefault        = core.ModeDefault
)

Re-export mode constants

View Source
const (
	ProviderOpenAI    = core.ProviderOpenAI
	ProviderAnthropic = core.ProviderAnthropic
	ProviderCohere    = core.ProviderCohere
	ProviderGoogle    = core.ProviderGoogle
)

Re-export provider constants

View Source
const (
	DefaultMaxRetries = core.DefaultMaxRetries
	DefaultValidator  = core.DefaultValidator
)

Re-export default constants

Variables

View Source
var (
	WithMode       = core.WithMode
	WithMaxRetries = core.WithMaxRetries
	WithValidation = core.WithValidation
	WithLogger     = core.WithLogger
	WithLogging    = core.WithLogging
)

Re-export option functions

View Source
var (
	NewSchema        = core.NewSchema
	NewUnionSchema   = core.NewUnionSchema
	ChatHandler      = core.ChatHandler
	ChatHandlerUnion = core.ChatHandlerUnion
	ExtractJSON      = core.ExtractJSON
	MergeOptions     = core.MergeOptions
)

Re-export core functions

View Source
var (
	NewNoopLogger       = core.NewNoopLogger
	NewLogger           = core.NewLogger
	NewTextLogger       = core.NewTextLogger
	NewLoggerFromString = core.NewLoggerFromString
	FromSlog            = core.FromSlog
	ContextWithLogger   = core.ContextWithLogger
	LoggerFromContext   = core.LoggerFromContext
)

Re-export logger functions

Functions

func FromAnthropic

func FromAnthropic(client *anthropicSDK.Client, opts ...Options) *anthropic.InstructorAnthropic

func FromCohere

func FromCohere(client *cohereSDK.Client, opts ...Options) *cohere.InstructorCohere

func FromGoogle

func FromGoogle(client *genai.Client, opts ...Options) *google.InstructorGoogle

func FromOpenAI

func FromOpenAI(client *openaiSDK.Client, opts ...Options) *openai.InstructorOpenAI

Re-export provider factory functions

func ToPtr

func ToPtr[T any](val T) *T

Re-export generic functions

Types

type GoogleRequest

type GoogleRequest = google.GoogleRequest

Re-export provider-specific request types

type GoogleResponse

type GoogleResponse = google.GoogleResponse

Re-export provider-specific request types

type Instructor

type Instructor = core.Instructor

Re-export core types and interfaces

type InstructorAnthropic

type InstructorAnthropic = anthropic.InstructorAnthropic

Re-export provider-specific types for backward compatibility

type InstructorCohere

type InstructorCohere = cohere.InstructorCohere

Re-export provider-specific types for backward compatibility

type InstructorGoogle

type InstructorGoogle = google.InstructorGoogle

Re-export provider-specific types for backward compatibility

type InstructorOpenAI

type InstructorOpenAI = openai.InstructorOpenAI

Re-export provider-specific types for backward compatibility

type Logger

type Logger = core.Logger

Re-export core types and interfaces

type Mode

type Mode = core.Mode

Re-export core types and interfaces

type Options

type Options = core.Options

Re-export core types and interfaces

type Provider

type Provider = core.Provider

Re-export core types and interfaces

type Schema

type Schema = core.Schema

Re-export core types and interfaces

type UnionOptions

type UnionOptions = core.UnionOptions

Re-export core types and interfaces

type UnionSchema

type UnionSchema = core.UnionSchema

Re-export core types and interfaces

type UnionValidationError

type UnionValidationError = core.UnionValidationError

Re-export core types and interfaces

type UsageSum

type UsageSum = core.UsageSum

Re-export core types and interfaces

Directories

Path Synopsis
providers

Jump to

Keyboard shortcuts

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