collectToolNames returns a set of tool function names present in the request.
(rawJSON []byte, format string)
| 113 | |
| 114 | // collectToolNames returns a set of tool function names present in the request. |
| 115 | func collectToolNames(rawJSON []byte, format string) map[string]struct{} { |
| 116 | f := GetFormat(format) |
| 117 | if f == nil { |
| 118 | return nil |
| 119 | } |
| 120 | names := f.CollectToolNames(rawJSON) |
| 121 | set := make(map[string]struct{}, len(names)) |
| 122 | for _, n := range names { |
| 123 | set[n] = struct{}{} |
| 124 | } |
| 125 | return set |
| 126 | } |
| 127 | |
| 128 | // collectToolNamesOpenAI extracts tool function names from an OpenAI request. |
| 129 | func collectToolNamesOpenAI(rawJSON []byte) []string { |
no test coverage detected