Skip to content

Commit

Permalink
Merge pull request #171 from valory-xyz/fix/tools
Browse files Browse the repository at this point in the history
fix: don't add markdown to url prompts
  • Loading branch information
0xArdi authored Feb 21, 2024
2 parents 3fbef67 + 05a7431 commit 3e72702
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
5 changes: 4 additions & 1 deletion tools/optimization_by_prompting/optimization_by_prompting.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ def count_tokens(text: str, model: str) -> int:
- "queries": An array of strings of size between 1 and 5. Each string must be a search engine query that can help obtain relevant information to estimate
the probability that the event in "USER_PROMPT" occurs. You must provide original information in each query, and they should not overlap
or lead to obtain the same set of results.
* Output only the JSON object. Do not include any other contents in your response.
* Output only the JSON object. Do not include any other contents in your response
* This is incorrect: "```json{{"queries": []}}```"
* This is incorrect: "```json"{{"queries": []}}"```"
* This is correct: "{{"queries": []}}".
"""

TEMPLATE_INSTRUCTOR = """You are an advanced reasoning agent that suggest to a bot ways to predict world events very accurately.
Expand Down
9 changes: 6 additions & 3 deletions tools/prediction_request/prediction_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ def count_tokens(text: str, model: str) -> int:
0 indicates lowest utility; 1 maximum utility.
* The sum of "p_yes" and "p_no" must equal 1.
* Output only the JSON object. Do not include any other contents in your response.
* This is incorrect:"```json{{\n \"p_yes\": 0.2,\n \"p_no\": 0.8,\n \"confidence\": 0.7,\n \"info_utility\": 0.5\n}}```"
* This is incorrect:```json"{{\n \"p_yes\": 0.2,\n \"p_no\": 0.8,\n \"confidence\": 0.7,\n \"info_utility\": 0.5\n}}"```
* This is correct:"{{\n \"p_yes\": 0.2,\n \"p_no\": 0.8,\n \"confidence\": 0.7,\n \"info_utility\": 0.5\n}}"
"""

URL_QUERY_PROMPT = """
Expand Down Expand Up @@ -157,9 +160,9 @@ def count_tokens(text: str, model: str) -> int:
or lead to obtain the same set of results.
* Output only the JSON object. Do not include any other contents in your response.
* Never use Markdown syntax highlighting, such as ```json``` to surround the output. Only output the raw json string.
* This is incorrect:"```json{{\n \"p_yes\": 0.2,\n \"p_no\": 0.8,\n \"confidence\": 0.7,\n \"info_utility\": 0.5\n}}```"
* This is incorrect:```json"{{\n \"p_yes\": 0.2,\n \"p_no\": 0.8,\n \"confidence\": 0.7,\n \"info_utility\": 0.5\n}}"```
* This is correct:"{{\n \"p_yes\": 0.2,\n \"p_no\": 0.8,\n \"confidence\": 0.7,\n \"info_utility\": 0.5\n}}"
* This is incorrect: "```json{{"queries": []}}```"
* This is incorrect: "```json"{{"queries": []}}"```"
* This is correct: "{{"queries": []}}"
"""


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ def count_tokens(text: str, model: str) -> int:
* The JSON must contain two fields: "queries", and "urls".
- "queries": A 1-5 item array of the generated search engine queries.
* Include only the JSON object in your output.
* This is incorrect: "```json{{"queries": []}}```"
* This is incorrect: "```json"{{"queries": []}}"```"
* This is correct: "{{"queries": []}}"
"""

# Global constants for possible attribute names for release and update dates
Expand Down
3 changes: 3 additions & 0 deletions tools/prediction_request_sme/prediction_request_sme.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ def count_tokens(text: str, model: str) -> int:
the probability that the event in "USER_PROMPT" occurs. You must provide original information in each query, and they should not overlap
or lead to obtain the same set of results.
* Output only the JSON object. Do not include any other contents in your response.
* This is incorrect: "```json{{"queries": []}}```"
* This is incorrect: "```json"{{"queries": []}}"```"
* This is correct: "{{"queries": []}}"
"""

SME_GENERATION_MARKET_PROMPT = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ def count_tokens(text: str, model: str) -> int:
* The JSON must contain two fields: "queries", and "urls".
- "queries": A 1-5 item array of the generated search engine queries.
* Include only the JSON object in your output.
* This is incorrect: "```json{{"queries": []}}```"
* This is incorrect: "```json"{{"queries": []}}"```"
* This is correct: "{{"queries": []}}"
"""

# Global constants for possible attribute names for release and update dates
Expand Down

0 comments on commit 3e72702

Please sign in to comment.