mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-01-09 07:28:05 -05:00
chore: embed ToolsetConfig into Toolset (#1885)
To keep a persistent backend storage for configuration, we will have to keep a single source of truth. This involves supporting bi-directional conversion between ToolsetConfig and Toolset. This PR make the following changes: * Embed ToolsetConfig in Toolset * Add `ToConfig()` to extract ToolsetConfig from Toolset.
This commit is contained in:
@@ -147,7 +147,10 @@ func TestUpdateServer(t *testing.T) {
|
||||
newTools := map[string]tools.Tool{"example-tool": nil}
|
||||
newToolsets := map[string]tools.Toolset{
|
||||
"example-toolset": {
|
||||
Name: "example-toolset", Tools: []*tools.Tool{},
|
||||
ToolsetConfig: tools.ToolsetConfig{
|
||||
Name: "example-toolset",
|
||||
},
|
||||
Tools: []*tools.Tool{},
|
||||
},
|
||||
}
|
||||
newPrompts := map[string]prompts.Prompt{"example-prompt": nil}
|
||||
|
||||
@@ -25,12 +25,16 @@ type ToolsetConfig struct {
|
||||
}
|
||||
|
||||
type Toolset struct {
|
||||
Name string `yaml:"name"`
|
||||
ToolsetConfig
|
||||
Tools []*Tool `yaml:",inline"`
|
||||
Manifest ToolsetManifest `yaml:",inline"`
|
||||
McpManifest []McpManifest `yaml:",inline"`
|
||||
}
|
||||
|
||||
func (t Toolset) ToConfig() ToolsetConfig {
|
||||
return t.ToolsetConfig
|
||||
}
|
||||
|
||||
type ToolsetManifest struct {
|
||||
ServerVersion string `json:"serverVersion"`
|
||||
ToolsManifest map[string]Manifest `json:"tools"`
|
||||
|
||||
Reference in New Issue
Block a user