mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-12 02:45:18 +00:00
Add error handling for empty system prompt in litellm_ai_handler and type conversion in utils.py
This commit is contained in:
parent
38638bd1c4
commit
e7e3970874
2 changed files with 5 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ def convert_to_markdown_v2(output_data: dict,
|
|||
else:
|
||||
markdown_text += f"### {emoji} {key_nice}: {value}\n\n"
|
||||
elif 'relevant tests' in key_nice.lower():
|
||||
value = value.strip().lower()
|
||||
value = str(value).strip().lower()
|
||||
if gfm_supported:
|
||||
markdown_text += f"<tr><td>"
|
||||
if is_value_no(value):
|
||||
|
|
|
|||
Loading…
Reference in a new issue