|
@@ -170,8 +170,14 @@ type MessageToolInvocationToolResult struct {
|
|
|
ToolName string `json:"toolName"`
|
|
ToolName string `json:"toolName"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// Model defines model for model.
|
|
|
|
|
-type Model struct {
|
|
|
|
|
|
|
+// ProviderInfo defines model for Provider.Info.
|
|
|
|
|
+type ProviderInfo struct {
|
|
|
|
|
+ Models map[string]ProviderModel `json:"models"`
|
|
|
|
|
+ Options *map[string]interface{} `json:"options,omitempty"`
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// ProviderModel defines model for Provider.Model.
|
|
|
|
|
+type ProviderModel struct {
|
|
|
Attachment bool `json:"attachment"`
|
|
Attachment bool `json:"attachment"`
|
|
|
ContextWindow float32 `json:"contextWindow"`
|
|
ContextWindow float32 `json:"contextWindow"`
|
|
|
Cost struct {
|
|
Cost struct {
|
|
@@ -185,12 +191,6 @@ type Model struct {
|
|
|
Reasoning *bool `json:"reasoning,omitempty"`
|
|
Reasoning *bool `json:"reasoning,omitempty"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// Provider defines model for provider.
|
|
|
|
|
-type Provider struct {
|
|
|
|
|
- Models map[string]Model `json:"models"`
|
|
|
|
|
- Options *map[string]interface{} `json:"options,omitempty"`
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// SessionInfo defines model for session.info.
|
|
// SessionInfo defines model for session.info.
|
|
|
type SessionInfo struct {
|
|
type SessionInfo struct {
|
|
|
Id string `json:"id"`
|
|
Id string `json:"id"`
|
|
@@ -1329,7 +1329,7 @@ func (r GetEventResponse) StatusCode() int {
|
|
|
type PostProviderListResponse struct {
|
|
type PostProviderListResponse struct {
|
|
|
Body []byte
|
|
Body []byte
|
|
|
HTTPResponse *http.Response
|
|
HTTPResponse *http.Response
|
|
|
- JSON200 *map[string]Provider
|
|
|
|
|
|
|
+ JSON200 *map[string]ProviderInfo
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Status returns HTTPResponse.Status
|
|
// Status returns HTTPResponse.Status
|
|
@@ -1625,7 +1625,7 @@ func ParsePostProviderListResponse(rsp *http.Response) (*PostProviderListRespons
|
|
|
|
|
|
|
|
switch {
|
|
switch {
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
|
- var dest map[string]Provider
|
|
|
|
|
|
|
+ var dest map[string]ProviderInfo
|
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
|
return nil, err
|
|
return nil, err
|
|
|
}
|
|
}
|