databricks-sdk-go icon indicating copy to clipboard operation
databricks-sdk-go copied to clipboard

[ISSUE] parameter \"tools\" is not supported when in Chat completion

Open qscez2001 opened this issue 11 months ago • 0 comments

Description When I'm building PoC of Agent, encountered this error. Model: Mixtral

Reproduction

Load the Agent

agent = AgentWithRetriever()

Example for testing multiple turns of converastion

1st turn of converastion

first_turn_input = { "messages": [ {"role": "user", "content": f"what is hazard identification?"}, ] }

response = agent.predict(model_input=first_turn_input)

2nd turn of converastion

new_messages = response["messages"] new_messages.append({"role": "user", "content": f"how do i use it?"})

print(type(new_messages))

second_turn_input = {"messages": new_messages} response = agent.predict(model_input=second_turn_input) print(response["content"])

Expected behavior Expected to use the tool retreived data

Is it a regression? Don't know

Debug Logs < for url: https://australiaeast.azuredatabricks.net/serving-endpoints/mixtral/invocations. Response text: {"error_code": null, "message": "unable to parse response. This is likely a bug in the Databricks SDK for Python or the underlying API. Please report this issue with the following debugging information to the SDK issue tracker at https://github.com/databricks/databricks-sdk-go/issues. Request log:POST /serving-endpoints/mixtral/invocations\n> * User-Agent: unknown/0.0.0 databricks-sdk-py/0.36.0 python/3.11.0rc1 os/linux auth/runtime runtime/15.4\n> * Accept-Encoding: gzip, deflate, br\n> * Accept: /\n> * Connection: keep-alive\n> * X-Databricks-Endpoints-API-Client: Databricks Deployment Client\n> * Content-Length: 791\n> * Content-Type: application/json\n> * Authorization: Bearer dkea8390f16f72baf5c7cc01cb1252d64a90\n> {\n> "max_tokens": 1500,\n> "messages": [\n> {\n> "content": "REDACTED",\n> "role": "system"\n> },\n> {\n> "content": "REDACTED",\n> "role": "user"\n> }\n> ],\n> "temperature": 0.01,\n> "tools": [\n> {\n> "function": {\n> "description": "Search for documents that are relevant to a user's query about the [REPLACE WITH DESCRIPTION OF YOUR DOCS].",\n> "name": "retrieve_documents",\n> "parameters": {\n> "properties": {\n> "query": {\n> "description": "The query to find documents about.",\n> "type": "string"\n> }\n> },\n> "required": [\n> "query"\n> ],\n> "type": "object"\n> }\n> },\n> "type": "function"\n> }\n> ]\n> }\n< 400 Bad Request\n< Bad request: parameter "tools" is not supported\n< ```" Other Information

  • OS: [e.g. macOS]
  • Version: [e.g. 0.1.0]

qscez2001 avatar Oct 31 '24 01:10 qscez2001