feat(agents): providing a seed so it has more predictable results

This commit is contained in:
2025-05-03 17:31:55 +01:00
parent 94920c01fb
commit 9860dd2dc5
2 changed files with 7 additions and 3 deletions

View File

@ -25,6 +25,8 @@ type AgentRequestBody struct {
Tools *any `json:"tools,omitempty"` Tools *any `json:"tools,omitempty"`
ToolChoice *string `json:"tool_choice,omitempty"` ToolChoice *string `json:"tool_choice,omitempty"`
RandomSeed *int `json:"random_seed,omitempty"`
EndToolCall string `json:"-"` EndToolCall string `json:"-"`
Chat *Chat `json:"messages"` Chat *Chat `json:"messages"`
@ -238,11 +240,13 @@ func (client *AgentClient) RunAgent(userId uuid.UUID, imageId uuid.UUID, imageNa
} }
toolChoice := "any" toolChoice := "any"
seed := 42
request := AgentRequestBody{ request := AgentRequestBody{
Tools: &tools, Tools: &tools,
ToolChoice: &toolChoice, ToolChoice: &toolChoice,
Model: "pixtral-12b-2409", Model: "pixtral-12b-2409",
RandomSeed: &seed,
Temperature: 0.3, Temperature: 0.3,
EndToolCall: client.Options.EndToolCall, EndToolCall: client.Options.EndToolCall,
ResponseFormat: ResponseFormat{ ResponseFormat: ResponseFormat{

View File

@ -80,15 +80,15 @@ const contactTools = `
}, },
"phoneNumber": { "phoneNumber": {
"type": "string", "type": "string",
"description": "The contact's primary phone number, including area or country code if available. Provide this if extracted from the image." "description": "The contact's primary phone number, including area or country code if available. Provide this if extracted from the image. Only include this if you see a phone number, do not make it up."
}, },
"address": { "address": {
"type": "string", "type": "string",
"description": "The complete physical mailing address of the contact (e.g., street number, street name, city, state/province, postal code, country). Provide this if extracted from the image." "description": "The complete physical mailing address of the contact (e.g., street number, street name, city, state/province, postal code, country). Provide this if extracted from the image. Only include this if you see an address. No not make it up."
}, },
"email": { "email": {
"type": "string", "type": "string",
"description": "The contact's primary email address. Provide this if extracted from the image." "description": "The contact's primary email address. Provide this if extracted from the image. Only include this if you see an email, do not make it up."
} }
}, },
"required": ["name"] "required": ["name"]