Skip to content

Commit

Permalink
Fix coordinate 0-100 and small tweaks (langchain-ai#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
dashesy authored Apr 5, 2023
1 parent 47ee174 commit a5449b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion langchain/agents/assistant/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def _extract_tool_and_input(self, llm_output: str, tries=0) -> Optional[Tuple[st
# TODO: separate llm to decide the task
if not action and (" is written" in sub_cmd or " text" in sub_cmd or sub_cmd.endswith(" say?")):
action = "OCR Understanding"
if not action and sub_cmd.startswith("search "):
if not action and (sub_cmd.startswith("search ") or " the name of " in sub_cmd):
action = "Bing Search"
if not action:
if tries < 4:
Expand Down
12 changes: 6 additions & 6 deletions langchain/agents/assistant/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Any time there is an image in our conversation that you want to know about objects description, texts, OCR (optical character recognition), people, celebrities inside of the image you could ask Assistant by addressing him.
These are the tasks that Assistant can handle for an image: photo editing, celebrities, business card, receipt, objects, OCR, Bing
Ask Assistant about the objects in the image.
Before any task ask Assistant about the objects in the input image.
Then if there is text in the image, ask Assistant to do OCR
For example to ask about an image that could be a business card, make sure the question has the word business card in it.
For example to ask about an image that could be a receipt, make sure the question has the word receipt in it.
Expand Down Expand Up @@ -65,7 +65,7 @@
soccer
<|im_sep|>{ai_prefix}
1. This is a group of men playing football kicking a soccer ball
To summerize, This is a group of men playing football kicking a soccer ball
<|im_end|>
In this image 90, 83 is the x, y cartesian coordinate of soccer ball
Expand All @@ -80,13 +80,13 @@
<|im_sep|>{ai_prefix}
1. This is not an image
2. I keep this in mind
I am glad you are happy about it
To summerize, I am glad you are happy about it
<|im_end|>
<|im_start|>Human
What is the most expensive type of my favourite fruit in the US?
<|im_sep|>{ai_prefix}
1. I do not have that information.
2. This question requires Bing search.
2. This question requires Internet search.
Assistant, Bing search what is the most expensive apple in the US?
EXAMPLE END
Expand Down Expand Up @@ -158,7 +158,7 @@
This image contains objects and their descriptions, object tags
List of object descriptions, and their location in this image:
heart 100 201
heart 50 61
List of object tags seen in this image:
pills
Expand All @@ -185,7 +185,7 @@
<|im_sep|>{ai_prefix}
1. I do not have that information.
2. This question requires further context.
3. This question requires Bing search.
3. This question requires Internet search.
Assistant, Bing search where can I buy SPRING VALLEY supplement pills? and how much is the price in Euros?
EXAMPLE END
Expand Down

0 comments on commit a5449b4

Please sign in to comment.