mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 04:40:38 +08:00
Add error handling for empty system prompt in litellm_ai_handler and type conversion in utils.py
This commit is contained in:
@ -106,6 +106,10 @@ class LiteLLMAIHandler(BaseAiHandler):
|
||||
deployment_id = self.deployment_id
|
||||
if self.azure:
|
||||
model = 'azure/' + model
|
||||
if 'claude' in model and not system:
|
||||
system = "\n"
|
||||
get_logger().warning(
|
||||
"Empty system prompt for claude model. Adding a newline character to prevent OpenAI API error.")
|
||||
messages = [{"role": "system", "content": system}, {"role": "user", "content": user}]
|
||||
if img_path:
|
||||
try:
|
||||
|
Reference in New Issue
Block a user