mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-01-11 16:38:15 -05:00
Compare commits
1 Commits
envvariabl
...
debug-opti
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4416b14ee6 |
@@ -319,6 +319,13 @@ func parseParamFromDelayedUnmarshaler(ctx context.Context, u *util.DelayedUnmars
|
||||
if err := dec.DecodeContext(ctx, a); err != nil {
|
||||
return nil, fmt.Errorf("unable to parse as %q: %w", t, err)
|
||||
}
|
||||
if a.Default != nil {
|
||||
intD, ok := a.Default.(uint64)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("default value fail to assert to type int64")
|
||||
}
|
||||
a.Default = int(intD)
|
||||
}
|
||||
if a.AuthSources != nil {
|
||||
logger.WarnContext(ctx, "`authSources` is deprecated, use `authServices` for parameters instead")
|
||||
a.AuthServices = append(a.AuthServices, a.AuthSources...)
|
||||
|
||||
@@ -150,7 +150,7 @@ func TestParametersMarshal(t *testing.T) {
|
||||
},
|
||||
},
|
||||
want: tools.Parameters{
|
||||
tools.NewIntParameterWithDefault("my_integer", uint64(5), "this param is an int"),
|
||||
tools.NewIntParameterWithDefault("my_integer", 5, "this param is an int"),
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user