Add projects
This commit is contained in:
parent
2d3a9ad623
commit
8b607dd700
1802 changed files with 503346 additions and 2 deletions
20
backend/internal/translator/common/responses.go
Normal file
20
backend/internal/translator/common/responses.go
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
package common
|
||||
|
||||
import "github.com/tidwall/sjson"
|
||||
|
||||
// SetResponsesToolCallIdentity writes a resolved Responses tool name and namespace.
|
||||
func SetResponsesToolCallIdentity(item []byte, name, namespace, itemPath string) []byte {
|
||||
namePath := "name"
|
||||
namespacePath := "namespace"
|
||||
if itemPath != "" {
|
||||
namePath = itemPath + ".name"
|
||||
namespacePath = itemPath + ".namespace"
|
||||
}
|
||||
item, _ = sjson.SetBytes(item, namePath, name)
|
||||
if namespace != "" {
|
||||
item, _ = sjson.SetBytes(item, namespacePath, namespace)
|
||||
} else {
|
||||
item, _ = sjson.DeleteBytes(item, namespacePath)
|
||||
}
|
||||
return item
|
||||
}
|
||||
Loading…
Reference in a new issue