Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweep: Feature Req: Add support for Mistral AI #670

Open
x-0D opened this issue Oct 7, 2024 · 0 comments
Open

Sweep: Feature Req: Add support for Mistral AI #670

x-0D opened this issue Oct 7, 2024 · 0 comments
Labels

Comments

@x-0D
Copy link

x-0D commented Oct 7, 2024

Details

Env:

Details

export OPENAI_API_MODEL=codestral-latest
export OPENAI_BASE_URL=https://api.mistral.ai/v1

Logs:
Details

│ /home/vscode/.local/lib/python3.10/site-packages/openai/_base_client.py:1051 in _request                                             │
│                                                                                                                                      │
│   1048 │   │   │   │   err.response.read()                                                                                           │
│   1049 │   │   │                                                                                                                     │
│   1050 │   │   │   log.debug("Re-raising status error")                                                                              │
│ ❱ 1051 │   │   │   raise self._make_status_error_from_response(err.response) from None                                               │
│   1052 │   │                                                                                                                         │
│   1053 │   │   return self._process_response(                                                                                        │
│   1054 │   │   │   cast_to=cast_to,                                                                                                  │
│                                                                                                                                      │
│ ╭───────────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────────╮ │
│ │     input_options = FinalRequestOptions(                                                                                         │ │
│ │                     │   method='post',                                                                                           │ │
│ │                     │   url='/chat/completions',                                                                                 │ │
│ │                     │   params={},                                                                                               │ │
│ │                     │   headers=NOT_GIVEN,                                                                                       │ │
│ │                     │   max_retries=NOT_GIVEN,                                                                                   │ │
│ │                     │   timeout=NOT_GIVEN,                                                                                       │ │
│ │                     │   files=None,                                                                                              │ │
│ │                     │   idempotency_key=None,                                                                                    │ │
│ │                     │   post_parser=NOT_GIVEN,                                                                                   │ │
│ │                     │   json_data={                                                                                              │ │
│ │                     │   │   'messages': [                                                                                        │ │
│ │                     │   │   │   {                                                                                                │ │
│ │                     │   │   │   │   'content': 'You are a `Supervisor` tasked with managing a conversation between the           │ │
│ │                     following'+2655,                                                                                             │ │
│ │                     │   │   │   │   'role': 'system'                                                                             │ │
│ │                     │   │   │   },                                                                                               │ │
│ │                     │   │   │   {                                                                                                │ │
│ │                     │   │   │   │   'content': 'We want to generate concise specifications for the web application.',            │ │
│ │                     │   │   │   │   'role': 'user'                                                                               │ │
│ │                     │   │   │   },                                                                                               │ │
│ │                     │   │   │   {                                                                                                │ │
│ │                     │   │   │   │   'content': "Given the conversation above, who should act next? Select one of:                │ │
│ │                     ['PRODUCT_OWNE"+74,                                                                                          │ │
│ │                     │   │   │   │   'role': 'user'                                                                               │ │
│ │                     │   │   │   }                                                                                                │ │
│ │                     │   │   ],                                                                                                   │ │
│ │                     │   │   'model': 'codestral-latest',                                                                         │ │
│ │                     │   │   'n': 1,                                                                                              │ │
│ │                     │   │   'parallel_tool_calls': False,                                                                        │ │
│ │                     │   │   'stream': True,                                                                                      │ │
│ │                     │   │   'temperature': 0.1,                                                                                  │ │
│ │                     │   │   'tool_choice': {'type': 'function', 'function': {'name': 'Assign'}},                                 │ │
│ │                     │   │   'tools': [                                                                                           │ │
│ │                     │   │   │   {                                                                                                │ │
│ │                     │   │   │   │   'type': 'function',                                                                          │ │
│ │                     │   │   │   │   'function': {                                                                                │ │
│ │                     │   │   │   │   │   'name': 'Assign',                                                                        │ │
│ │                     │   │   │   │   │   'description': '',                                                                       │ │
│ │                     │   │   │   │   │   'parameters': {                                                                          │ │
│ │                     │   │   │   │   │   │   'properties': {                                                                      │ │
│ │                     │   │   │   │   │   │   │   'assign': {                                                                      │ │
│ │                     │   │   │   │   │   │   │   │   'description': "The worker to assign the task from members(['PRODUCT_OWNER', │ │
│ │                     'ENGINEER', 'ARCHIT"+52,                                                                                     │ │
│ │                     │   │   │   │   │   │   │   │   'type': 'string'                                                             │ │
│ │                     │   │   │   │   │   │   │   }                                                                                │ │
│ │                     │   │   │   │   │   │   },                                                                                   │ │
│ │                     │   │   │   │   │   │   'required': ['assign'],                                                              │ │
│ │                     │   │   │   │   │   │   'type': 'object'                                                                     │ │
│ │                     │   │   │   │   │   }                                                                                        │ │
│ │                     │   │   │   │   }                                                                                            │ │
│ │                     │   │   │   }                                                                                                │ │
│ │                     │   │   ]                                                                                                    │ │
│ │                     │   },                                                                                                       │ │
│ │                     │   extra_json=None                                                                                          │ │
│ │                     )                                                                                                            │ │
│ │            kwargs = {}                                                                                                           │ │
│ │           options = FinalRequestOptions(                                                                                         │ │
│ │                     │   method='post',                                                                                           │ │
│ │                     │   url='/chat/completions',                                                                                 │ │
│ │                     │   params={},                                                                                               │ │
│ │                     │   headers=NOT_GIVEN,                                                                                       │ │
│ │                     │   max_retries=NOT_GIVEN,                                                                                   │ │
│ │                     │   timeout=NOT_GIVEN,                                                                                       │ │
│ │                     │   files=None,                                                                                              │ │
│ │                     │   idempotency_key=None,                                                                                    │ │
│ │                     │   post_parser=NOT_GIVEN,                                                                                   │ │
│ │                     │   json_data={                                                                                              │ │
│ │                     │   │   'messages': [                                                                                        │ │
│ │                     │   │   │   {                                                                                                │ │
│ │                     │   │   │   │   'content': 'You are a `Supervisor` tasked with managing a conversation between the           │ │
│ │                     following'+2655,                                                                                             │ │
│ │                     │   │   │   │   'role': 'system'                                                                             │ │
│ │                     │   │   │   },                                                                                               │ │
│ │                     │   │   │   {                                                                                                │ │
│ │                     │   │   │   │   'content': 'We want to generate concise specifications for the web application.',            │ │
│ │                     │   │   │   │   'role': 'user'                                                                               │ │
│ │                     │   │   │   },                                                                                               │ │
│ │                     │   │   │   {                                                                                                │ │
│ │                     │   │   │   │   'content': "Given the conversation above, who should act next? Select one of:                │ │
│ │                     ['PRODUCT_OWNE"+74,                                                                                          │ │
│ │                     │   │   │   │   'role': 'user'                                                                               │ │
│ │                     │   │   │   }                                                                                                │ │
│ │                     │   │   ],                                                                                                   │ │
│ │                     │   │   'model': 'codestral-latest',                                                                         │ │
│ │                     │   │   'n': 1,                                                                                              │ │
│ │                     │   │   'parallel_tool_calls': False,                                                                        │ │
│ │                     │   │   'stream': True,                                                                                      │ │
│ │                     │   │   'temperature': 0.1,                                                                                  │ │
│ │                     │   │   'tool_choice': {'type': 'function', 'function': {'name': 'Assign'}},                                 │ │
│ │                     │   │   'tools': [                                                                                           │ │
│ │                     │   │   │   {                                                                                                │ │
│ │                     │   │   │   │   'type': 'function',                                                                          │ │
│ │                     │   │   │   │   'function': {                                                                                │ │
│ │                     │   │   │   │   │   'name': 'Assign',                                                                        │ │
│ │                     │   │   │   │   │   'description': '',                                                                       │ │
│ │                     │   │   │   │   │   'parameters': {                                                                          │ │
│ │                     │   │   │   │   │   │   'properties': {                                                                      │ │
│ │                     │   │   │   │   │   │   │   'assign': {                                                                      │ │
│ │                     │   │   │   │   │   │   │   │   'description': "The worker to assign the task from members(['PRODUCT_OWNER', │ │
│ │                     'ENGINEER', 'ARCHIT"+52,                                                                                     │ │
│ │                     │   │   │   │   │   │   │   │   'type': 'string'                                                             │ │
│ │                     │   │   │   │   │   │   │   }                                                                                │ │
│ │                     │   │   │   │   │   │   },                                                                                   │ │
│ │                     │   │   │   │   │   │   'required': ['assign'],                                                              │ │
│ │                     │   │   │   │   │   │   'type': 'object'                                                                     │ │
│ │                     │   │   │   │   │   }                                                                                        │ │
│ │                     │   │   │   │   }                                                                                            │ │
│ │                     │   │   │   }                                                                                                │ │
│ │                     │   │   ]                                                                                                    │ │
│ │                     │   },                                                                                                       │ │
│ │                     │   extra_json=None                                                                                          │ │
│ │                     )                                                                                                            │ │
│ │ remaining_retries = 2                                                                                                            │ │
│ │           request = <Request('POST', 'https://api.mistral.ai/v1/chat/completions')>                                              │ │
│ │          response = <Response [422 Unprocessable Entity]>                                                                        │ │
│ │     retries_taken = 0                                                                                                            │ │
│ │              self = <openai._ModuleClient object at 0xffff943d26b0>                                                              │ │
│ │            stream = True                                                                                                         │ │
│ │        stream_cls = openai.Stream[openai.types.chat.chat_completion_chunk.ChatCompletionChunk]                                   │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
UnprocessableEntityError: Error code: 422 - {'object': 'error', 'message': {'detail': [{'type': 'enum', 'loc': ['body', 'tool_choice'], 
'msg': "Input should be 'auto', 'none' or 'any'", 'input': {'type': 'function', 'function': {'name': 'Assign'}}, 'ctx': {'expected': 
"'auto', 'none' or 'any'"}}, {'type': 'extra_forbidden', 'loc': ['body', 'parallel_tool_calls'], 'msg': 'Extra inputs are not 
permitted', 'input': False}]}, 'type': 'invalid_request_error', 'param': None, 'code': None}

Looks like you need to add ChatMistralAI support from langchain.
https://python.langchain.com/docs/integrations/chat/mistralai/

@x-0D x-0D added the sweep label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant