Documentation
¶
Index ¶
- func ForValue(value any) (*jsonschema.Schema, error)
- func GenerateEnumContent[T interface{ ... }](ctx context.Context, client *genai.Client, model string, ...) (T, error)
- func GenerateObjectContent[T any](ctx context.Context, client *genai.Client, model string, ...) (T, error)
- func GenerateObjectContents[T any](ctx context.Context, client *genai.Client, model string, ...) ([]T, error)
- func GenerateRawContents[T any](ctx context.Context, client *genai.Client, model string, ...) (*genai.GenerateContentResponse, error)
- func GenerateTextContent[T any](ctx context.Context, client *genai.Client, model string, ...) (string, error)
- func GenerateTextContents[T any](ctx context.Context, client *genai.Client, model string, ...) ([]string, error)
- func SchemaFor[T any]() (*jsonschema.Schema, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForValue ¶
func ForValue(value any) (*jsonschema.Schema, error)
ForValue returns a JSON Schema for the given value, with custom struct tag post-processing applied.
func GenerateEnumContent ¶
func GenerateEnumContent[T interface {
~string
Enum() []any
}](ctx context.Context, client *genai.Client, model string, contents []*genai.Content, config *genai.GenerateContentConfig) (T, error)
GenerateEnumContent returns the first enum candidate from the model using T as response schema of controlled generation. It uses ResponseSchema with text/x.enum MIME type (not ResponseJsonSchema) since the enum API requires this combination.
func GenerateObjectContent ¶
func GenerateObjectContent[T any](ctx context.Context, client *genai.Client, model string, contents []*genai.Content, config *genai.GenerateContentConfig) (T, error)
GenerateObjectContent returns the first candidate object from the model using T as response schema of controlled generation.
func GenerateObjectContents ¶
func GenerateObjectContents[T any](ctx context.Context, client *genai.Client, model string, contents []*genai.Content, config *genai.GenerateContentConfig) ([]T, error)
GenerateObjectContents returns the candidate objects from the model using T as response schema of controlled generation.
func GenerateRawContents ¶
func GenerateRawContents[T any](ctx context.Context, client *genai.Client, model string, contents []*genai.Content, config *genai.GenerateContentConfig) (*genai.GenerateContentResponse, error)
GenerateRawContents returns the raw response from the model using T as response schema of controlled generation.
func GenerateTextContent ¶
func GenerateTextContent[T any](ctx context.Context, client *genai.Client, model string, contents []*genai.Content, config *genai.GenerateContentConfig) (string, error)
GenerateTextContent returns the first text candidate from the model using T as response schema of controlled generation.
func GenerateTextContents ¶
func GenerateTextContents[T any](ctx context.Context, client *genai.Client, model string, contents []*genai.Content, config *genai.GenerateContentConfig) ([]string, error)
GenerateTextContents returns the text candidates from the model using T as response schema of controlled generation.
Types ¶
This section is empty.