mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-20 04:20:39 +08:00
s
This commit is contained in:
@ -113,7 +113,7 @@ class LiteLLMAIHandler(BaseAiHandler):
|
||||
import requests
|
||||
r = requests.get(img_path, allow_redirects=True)
|
||||
if r.status_code == 404:
|
||||
error_msg = "The image link is not alive. Please repost the image, get a new address, and send the question again."
|
||||
error_msg = f"The image link is not [alive](img_path).\nPlease repost the original image as a comment, and send the question again with 'quote reply' (see [instructions](https://pr-agent-docs.codium.ai/tools/ask/#ask-on-images-using-the-pr-code-as-context))."
|
||||
get_logger().error(error_msg)
|
||||
return f"{error_msg}", "error"
|
||||
messages[1]["content"] = [{"type": "text", "text": messages[1]["content"]},
|
||||
|
@ -88,7 +88,7 @@ async def handle_comments_on_pr(body: Dict[str, Any],
|
||||
if comment_body and isinstance(comment_body, str) and not comment_body.lstrip().startswith("/"):
|
||||
if '/ask' in comment_body and comment_body.strip().startswith('> ![image]'):
|
||||
comment_body_split = comment_body.split('/ask')
|
||||
comment_body = '/ask' + comment_body_split[1] +'/n' +comment_body_split[0].strip()
|
||||
comment_body = '/ask' + comment_body_split[1] +' \n' +comment_body_split[0].strip().lstrip('>')
|
||||
get_logger().info(f"Reformatting comment_body so command is at the beginning: {comment_body}")
|
||||
else:
|
||||
get_logger().info("Ignoring comment not starting with /")
|
||||
|
Reference in New Issue
Block a user