@@ -6,6 +6,33 @@ import (
66 functions "github.com/mudler/LocalAI/pkg/functions"
77)
88
9+ type ApproximateLocation struct {
10+ Country string `json:"country,omitempty"`
11+ City string `json:"city,omitempty"`
12+ Region string `json:"region,omitempty"`
13+ }
14+
15+ type UserLocation struct {
16+ Type string `json:"type,omitempty"`
17+ Approximate * ApproximateLocation `json:"approximate,omitempty"`
18+ }
19+
20+ type WebSearchOptions struct {
21+ UserLocation * UserLocation `json:"user_location,omitempty"`
22+ }
23+
24+ type UrlCitation struct {
25+ EndIndex int `json:"end_index,omitempty"`
26+ StartIndex int `json:"start_index,omitempty"`
27+ Title string `json:"title,omitempty"`
28+ URL string `json:"url,omitempty"`
29+ }
30+
31+ type Annotation struct {
32+ Type string `json:"type,omitempty"`
33+ UrlCitation * UrlCitation `json:"url_citation,omitempty"`
34+ }
35+
936// APIError provides error information returned by the OpenAI API.
1037type APIError struct {
1138 Code any `json:"code,omitempty"`
@@ -150,6 +177,9 @@ type OpenAIRequest struct {
150177 // Messages is read only by chat/completion API calls
151178 Messages []Message `json:"messages" yaml:"messages"`
152179
180+ // WebSearchOptions for Deep Research
181+ WebSearchOptions * WebSearchOptions `json:"web_search_options,omitempty"`
182+
153183 // A list of available functions to call
154184 Functions functions.Functions `json:"functions" yaml:"functions"`
155185 FunctionCall interface {} `json:"function_call" yaml:"function_call"` // might be a string or an object
0 commit comments