Go SDK: Align hooks with SEP (#23)
The SEP spec and C# SDK use hooks (plural, JSON array) but the Go SDK
had hook (singular, single object). This meant the wire formats were
incompatible — Go would send `{"hook": {...}}` while everything else
expects `{"hooks": [...]}`.
Signed-off-by: Ukjae Jeong <jeongukjae@gmail.com>
This commit is contained in:
parent
2b1d10093e
commit
23d889254b
1 changed files with 110 additions and 92 deletions
|
|
@ -45,10 +45,10 @@
|
|||
// v := &interceptors.Validator{
|
||||
// Metadata: interceptors.Metadata{
|
||||
// Name: "block-dangerous-tool",
|
||||
// Hook: interceptors.Hook{
|
||||
// Hooks: []interceptors.Hook{{
|
||||
// Events: []string{"tools/call"},
|
||||
// Phase: interceptors.PhaseRequest,
|
||||
// },
|
||||
// }},
|
||||
// Mode: interceptors.ModeEnforce,
|
||||
// },
|
||||
// Handler: func(ctx context.Context, inv *interceptors.Invocation) (*interceptors.ValidationResult, error) {
|
||||
|
|
@ -73,10 +73,10 @@
|
|||
// m := &interceptors.Mutator{
|
||||
// Metadata: interceptors.Metadata{
|
||||
// Name: "redact-pii",
|
||||
// Hook: interceptors.Hook{
|
||||
// Hooks: []interceptors.Hook{{
|
||||
// Events: []string{"tools/call"},
|
||||
// Phase: interceptors.PhaseResponse,
|
||||
// },
|
||||
// }},
|
||||
// Mode: interceptors.ModeEnforce,
|
||||
// },
|
||||
// Handler: func(ctx context.Context, inv *interceptors.Invocation) (*interceptors.MutationResult, error) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue