mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-28 19:05:31 +02:00
More fixes for litellm, openrouter support
This commit is contained in:
parent
14eee3e0c3
commit
118c724ad7
8 changed files with 33 additions and 23 deletions
|
|
@ -49,15 +49,7 @@ def set_sys_message(messages):
|
|||
"""
|
||||
If the system message is empty, set it to the default message: "You are a helplful assistant."
|
||||
"""
|
||||
if not any(msg.get("role") == "system" for msg in messages):
|
||||
messages.insert(0, {
|
||||
"role": "system",
|
||||
"content": "You are a helpful assistant."
|
||||
})
|
||||
print("Inserted system message: ", messages[0])
|
||||
logger.info("Inserted system message: ", messages[0])
|
||||
|
||||
elif messages[0].get("role") == "system" and messages[0].get("content") == "":
|
||||
if messages[0].get("role") == "system" and messages[0].get("content") == "":
|
||||
messages[0]["content"] = "You are a helpful assistant."
|
||||
print("Updated system message: ", messages[0])
|
||||
logger.info("Updated system message: ", messages[0])
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ async def mock_tool(tool_name: str, args: str, description: str, mock_instructio
|
|||
print(f"Generating simulated response for tool: {tool_name}")
|
||||
response_content = None
|
||||
response_content = generate_openai_output(messages, output_type='text', model=PROVIDER_DEFAULT_MODEL)
|
||||
print("Custom provider client not found, using default model: gpt-4o")
|
||||
return response_content
|
||||
except Exception as e:
|
||||
logger.error(f"Error in mock_tool: {str(e)}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue