1
0
mirror of https://github.com/coalaura/whiskr.git synced 2025-09-09 09:19:54 +00:00

github tool

This commit is contained in:
Laura
2025-08-25 18:37:30 +02:00
parent b44da19987
commit 908fdb2e93
9 changed files with 307 additions and 7 deletions

View File

@@ -137,7 +137,7 @@ func (r *Request) Parse() (*openrouter.ChatCompletionRequest, error) {
request.Tools = GetSearchTools()
request.ToolChoice = "auto"
request.Messages = append(request.Messages, openrouter.SystemMessage("You have access to web search tools. Use `search_web` with `query` (string) and `num_results` (1-10) to find current information and get result summaries. Use `fetch_contents` with `urls` (array) to read full page content. Always specify all parameters for each tool call. Call only one tool per response."))
request.Messages = append(request.Messages, openrouter.SystemMessage(InternalToolsPrompt))
}
for index, message := range r.Messages {
@@ -302,6 +302,13 @@ func HandleChat(w http.ResponseWriter, r *http.Request) {
if err != nil {
response.Send(ErrorChunk(err))
return
}
case "github_repository":
err = HandleGitHubRepositoryTool(ctx, tool)
if err != nil {
response.Send(ErrorChunk(err))
return
}
default: