add new mistral model
Browse files516 unmodified lines517518519520521522523524525526527153 unmodified lines6816826836796806846856866876882000 unmodified lines2689269026912687269226932694269537 unmodified lines27332734273527312736273727382739516 unmodified lines "id": "codestral-2508", "description": "Mistral Codestral model - specialized for code generation and programming tasks" }, { "name": "Mistral Medium 2508", "id": "mistral-medium-2508", "description": "Mistral Medium 2508 model via Mistral API for general tasks and coding" }, { "name": "Gemini 2.5 Flash", "id": "gemini-2.5-flash",153 unmodified lines api_key=os.getenv("STEP_API_KEY"), base_url="https://api.stepfun.com/v1" ) elif model_id == "codestral-2508": # Use Mistral client for Codestral model elif model_id == "codestral-2508" or model_id == "mistral-medium-2508": # Use Mistral client for Mistral models return Mistral(api_key=os.getenv("MISTRAL_API_KEY")) elif model_id == "gemini-2.5-flash": # Use Google Gemini (OpenAI-compatible) client2000 unmodified lines messages.append({'role': 'user', 'content': enhanced_query}) try: # Handle Mistral API method difference if _current_model["id"] == "codestral-2508": if _current_model["id"] in ("codestral-2508", "mistral-medium-2508"): completion = client.chat.stream( model=_current_model["id"], messages=messages,37 unmodified lines for chunk in completion: # Handle different response formats for Mistral vs others chunk_content = None if _current_model["id"] == "codestral-2508": if _current_model["id"] in ("codestral-2508", "mistral-medium-2508"): # Mistral format: chunk.data.choices[0].delta.content if ( hasattr(chunk, "data") and chunk.data andapp.py+9-4