eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
20.02k stars 2.5k forks source link

documentation on what text response recognized by Theia 1.54.0 as tool call #14357

Open bardThis opened 2 hours ago

bardThis commented 2 hours ago

Feature request: documentation on what tool call trigger is answered by Theia effectively. Then user can try to figure out how to coerce the model to output Theia-compatible tool call. I've tried two ollama models that seem to be trying to calling tools (and listed as tools models on the ollama registry). However the style of text they are returning is not recognized by Theia as a tool call.

Theia AI Configuration [Experimental] Agents -> Workspace Chat

ollama model 1: Identifier: ollama/mistral-nemo:12b-instruct-2407-q2_K Name: mistral-nemo:12b-instruct-2407-q2_K Vendor: Ollama

Response: [TOOL_CALLS][{"name": "getWorkspaceFileList", "arguments": {}}]


feature request: problem description "[TOOL_CALLS]" is not recognized by Theia as a tool call, need documentation on what the workaround is here.

User tries switching to ollama model 2: Identifier: ollama/nemotron-mini:4b-instruct-q6_K Name: nemotron-mini:4b-instruct-q6_K Vendor: Ollama

Request

@Workspace try again, i know you can use tools; list the most important files in my workspace Response

 <toolcall> {"name":"getWorkspaceFileList","arguments": {}} </toolcall>

Timestamp: 10/26/2024, 12:39:25 PM


feature request: problem description "toolcall" is not recognized by Theia as a tool call, need documentation on what the workaround is here.

Although there is a response that looks like a toolcal the only thing displayed is the attempted toolcall and no other information.

Not sure if this code is an anchorpoint for this feature but seems to be a good starting point for investigation: https://github.com/eclipse-theia/theia/blob/c1e4279cf85aff0b4fdfccbe605fc391aa599e0a/packages/ai-chat/src/common/chat-model.ts#L509

Eclipse Theia IDE Version 1.54.0 VS Code API Version: 1.93.1 thank you

bardThis commented 2 hours ago

Maybe better worded: requesting please a way to see model interaction history to verify if Theia 1.54.0 is sending a tool call to ollama in the format described in the link from the ollama repo below (and to check the response). The AI Agent history is great but looks nothing like an ollama toolcall for my attempted tools requests.

problem description: model interaction with ollama tools model looks like the screenshot, but it actually should look more like the text below this screenshot image

Below text from https://github.com/ollama/ollama/blob/main/docs/api.md#chat-request-with-tools would be more debuggable.

Request

curl http://localhost:11434/api/chat -d '{
  "model": "llama3.2",
  "messages": [
    {
      "role": "user",
      "content": "What is the weather today in Paris?"
    }
  ],
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_current_weather",
        "description": "Get the current weather for a location",
        "parameters": {
          "type": "object",
          "properties": {
            "location": {
              "type": "string",
              "description": "The location to get the weather for, e.g. San Francisco, CA"
            },
            "format": {
              "type": "string",
              "description": "The format to return the weather in, e.g. 'celsius' or 'fahrenheit'",
              "enum": ["celsius", "fahrenheit"]
            }
          },
          "required": ["location", "format"]
        }
      }
    }
  ]
}'

Response

{
  "model": "llama3.2",
  "created_at": "2024-07-22T20:33:28.123648Z",
  "message": {
    "role": "assistant",
    "content": "",
    "tool_calls": [
      {
        "function": {
          "name": "get_current_weather",
          "arguments": {
            "format": "celsius",
            "location": "Paris, FR"
          }
        }
      }
    ]
  },
  "done_reason": "stop",
  "done": true,
  "total_duration": 885095291,
  "load_duration": 3753500,
  "prompt_eval_count": 122,
  "prompt_eval_duration": 328493000,
  "eval_count": 33,
  "eval_duration": 552222000
}