feat: publish sanitized custom.97 source
This commit is contained in:
1022 files changed
+69903
-19207
No files matched your search
@@ -3,6 +3,7 @@ package toolconv
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/QuantumNous/new-api/relaykit/relayconvert/convmeta"
|
||||
"github.com/QuantumNous/new-api/relaykit/types"
|
||||
)
|
||||
|
||||
@@ -33,26 +34,18 @@ type Function struct {
|
||||
Description string
|
||||
Parameters any
|
||||
Strict *bool
|
||||
// OpenAPISchema marks Parameters written in Gemini's OpenAPI schema
|
||||
// subset (uppercase type names, nullable, propertyOrdering) rather than
|
||||
// JSON Schema.
|
||||
OpenAPISchema bool
|
||||
}
|
||||
|
||||
type ApproximateLocation struct {
|
||||
City string
|
||||
Region string
|
||||
Country string
|
||||
Timezone string
|
||||
}
|
||||
|
||||
type WebSearch struct {
|
||||
Location *ApproximateLocation
|
||||
AllowedDomains []string
|
||||
BlockedDomains []string
|
||||
SearchContextSize string
|
||||
MaxUses *int
|
||||
AllowedCallers []string
|
||||
ResponseInclusion string
|
||||
ExternalWebAccess *bool
|
||||
ReturnTokenBudget json.RawMessage
|
||||
}
|
||||
// ApproximateLocation and WebSearch are the convmeta types, so a host
|
||||
// web-search encoder receives the decoded specification unchanged.
|
||||
type (
|
||||
ApproximateLocation = convmeta.ApproximateLocation
|
||||
WebSearch = convmeta.WebSearch
|
||||
)
|
||||
|
||||
type Definition struct {
|
||||
Kind Kind
|
||||
@@ -63,6 +56,9 @@ type Definition struct {
|
||||
WebSearch *WebSearch
|
||||
Raw json.RawMessage
|
||||
Group int
|
||||
// Namespace is the Responses tool namespace the definition was declared
|
||||
// in. Name and Function.Name already hold the flattened upstream name.
|
||||
Namespace string
|
||||
}
|
||||
|
||||
type ChoiceMode string
|
||||
@@ -92,10 +88,16 @@ type Set struct {
|
||||
ParallelAllowed *bool
|
||||
NativeToolConfig json.RawMessage
|
||||
History []HostedHistoryItem
|
||||
// Diagnostics reports losses found while extracting the definitions; they
|
||||
// are returned with the attach diagnostics.
|
||||
Diagnostics []types.ConversionDiagnostic
|
||||
// Model is the upstream model the definitions are attached for; target
|
||||
// capability checks read it. The caller of AttachRequest sets it.
|
||||
Model string
|
||||
}
|
||||
|
||||
func (s Set) Empty() bool {
|
||||
return len(s.Definitions) == 0 && s.Choice == nil && s.ParallelAllowed == nil && len(s.NativeToolConfig) == 0 && len(s.History) == 0
|
||||
return len(s.Definitions) == 0 && s.Choice == nil && s.ParallelAllowed == nil && len(s.NativeToolConfig) == 0 && len(s.History) == 0 && len(s.Diagnostics) == 0
|
||||
}
|
||||
|
||||
type HostedHistoryItem struct {
|
||||
|
||||
Reference in new issue
Block a user