enumNames returns the sorted keys of a name→uid map for use as a JSON schema enum. The sort is stable across calls so the schema doesn't churn.
(byName map[string]string)
| 121 | // enumNames returns the sorted keys of a name→uid map for use as a JSON |
| 122 | // schema enum. The sort is stable across calls so the schema doesn't churn. |
| 123 | func enumNames(byName map[string]string) []string { |
| 124 | out := make([]string, 0, len(byName)) |
| 125 | for k := range byName { |
| 126 | out = append(out, k) |
| 127 | } |
| 128 | sort.Strings(out) |
| 129 | return out |
| 130 | } |
| 131 | |
| 132 | func newReadTool(byName map[string]string, mgr *Manager) llmproxy.FunctionTool { |
| 133 | return llmproxy.FunctionTool{ |
no outgoing calls
no test coverage detected