Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1103e10 commit d105918Copy full SHA for d105918
coderd/chat.go
@@ -179,13 +179,13 @@ func (api *API) postChatMessages(w http.ResponseWriter, r *http.Request) {
179
client := codersdk.New(api.AccessURL)
180
client.SetSessionToken(httpmw.APITokenFromRequest(r))
181
182
- tools := make([]aisdk.Tool, len(toolsdk.All))
+ tools := make([]aisdk.Tool, 0)
183
handlers := map[string]toolsdk.GenericHandlerFunc{}
184
- for i, tool := range toolsdk.All {
+ for _, tool := range toolsdk.All {
185
if tool.Name == "coder_report_task" {
186
continue // This tool requires an agent to run.
187
}
188
- tools[i] = tool.Tool
+ tools = append(tools, tool.Tool)
189
handlers[tool.Tool.Name] = tool.Handler
190
191
0 commit comments