Documentation
¶
Index ¶
- func AppendInstructions(r *model.LLMRequest, instructions ...string)
- func Content(ev *session.Event) *genai.Content
- func FunctionCalls(c *genai.Content) (ret []*genai.FunctionCall)
- func FunctionDecls(c *genai.GenerateContentConfig) (ret []*genai.FunctionDeclaration)
- func FunctionResponses(c *genai.Content) (ret []*genai.FunctionResponse)
- func Must[T agent.Agent](a T, err error) T
- func PopulateClientFunctionCallID(c *genai.Content)
- func RemoveClientFunctionCallID(c *genai.Content)
- func TextParts(c *genai.Content) (ret []string)
- func ValidateMapOnSchema(args map[string]any, schema *genai.Schema, isInput bool) error
- func ValidateOutputSchema(output string, schema *genai.Schema) (map[string]any, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendInstructions ¶
func AppendInstructions(r *model.LLMRequest, instructions ...string)
func FunctionCalls ¶
func FunctionCalls(c *genai.Content) (ret []*genai.FunctionCall)
Belows are useful utilities that help working with genai.Content included in types.Event. TODO: Use generics. FunctionCalls extracts all FunctionCall parts from the content.
func FunctionDecls ¶
func FunctionDecls(c *genai.GenerateContentConfig) (ret []*genai.FunctionDeclaration)
FunctionDecls extracts all Function declarations from the GenerateContentConfig.
func FunctionResponses ¶
func FunctionResponses(c *genai.Content) (ret []*genai.FunctionResponse)
FunctionResponses extracts all FunctionResponse parts from the content.
func PopulateClientFunctionCallID ¶
PopulateClientFunctionCallID sets the function call ID field if it is empty. Since the ID field is optional, some models don't fill the field, but the LLMAgent depends on the IDs to map FunctionCall and FunctionResponse events in the event stream.
func RemoveClientFunctionCallID ¶
RemoveClientFunctionCallID removes the function call ID field that was set by populateClientFunctionCallID. This is necessary when FunctionCall or FunctionResponse are sent back to the model.
func ValidateMapOnSchema ¶
ValidateMapOnSchema validates a map against a schema.
Types ¶
This section is empty.