DylanonWic commited on
Commit
7911c46
1 Parent(s): bae1f56

Upload 18 files

Browse files
Files changed (3) hide show
  1. prompt.py +1 -1
  2. test.ipynb +22 -15
  3. tools.py +1 -1
prompt.py CHANGED
@@ -3,7 +3,7 @@ agent_meta = [
3
  "name": "analyst",
4
  "prompt": """
5
  You are the Analyst. Extract the location and keyword (e.g., 'shop', 'coffee shop') from the user’s request and instruct the Data Collector to gather relevant data. Ensure all communication is in English.
6
- If user continue to ask about assumtion such as "if i open coffee shop here what price should i sell", or "can we sell in price 130 bath here", it your role to answer the customer question based on the data from reporter, please incoude an reference of your answer, if the data are reported don't search anything don't use a tools just answer from data that reporter provide, and prefix your answer with '%SIjfE923hf' when responding to the user's question.
7
  """
8
  },
9
  {
 
3
  "name": "analyst",
4
  "prompt": """
5
  You are the Analyst. Extract the location and keyword (e.g., 'shop', 'coffee shop') from the user’s request and instruct the Data Collector to gather relevant data. Ensure all communication is in English.
6
+ If user continue to ask about assumtion such as "if i open coffee shop here what price should i sell", or "can we sell in price 130 bath here", it your role to answer the customer question based on the data from reporter, please include an reference of your answer and show the reference data, if the data are reported don't search anything don't use a tools just answer from data that reporter provide, and prefix your answer with '%SIjfE923hf' when responding to the user's question.
7
  """
8
  },
9
  {
test.ipynb CHANGED
@@ -2,33 +2,40 @@
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
- "execution_count": 2,
6
- "metadata": {},
7
- "outputs": [],
8
- "source": [
9
- "from langchain_experimental.tools import PythonREPLTool\n",
10
- "\n",
11
- "python_repl_tool = PythonREPLTool()"
12
- ]
13
- },
14
- {
15
- "cell_type": "code",
16
- "execution_count": 4,
17
  "metadata": {},
18
  "outputs": [
19
  {
20
  "data": {
21
  "text/plain": [
22
- "'A Python shell. Use this to execute python commands. Input should be a valid python command. If you want to see the output of a value, you should print it out with `print(...)`.'"
23
  ]
24
  },
25
- "execution_count": 4,
26
  "metadata": {},
27
  "output_type": "execute_result"
28
  }
29
  ],
30
  "source": [
31
- "python_repl_tool.description"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  ]
33
  }
34
  ],
 
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
+ "execution_count": 14,
 
 
 
 
 
 
 
 
 
 
 
6
  "metadata": {},
7
  "outputs": [
8
  {
9
  "data": {
10
  "text/plain": [
11
+ "97"
12
  ]
13
  },
14
+ "execution_count": 14,
15
  "metadata": {},
16
  "output_type": "execute_result"
17
  }
18
  ],
19
  "source": [
20
+ "import utils\n",
21
+ "\n",
22
+ "utils.load_env()\n",
23
+ "\n",
24
+ "from langchain.llms import OpenAI\n",
25
+ "\n",
26
+ "# Create an instance of the OpenAI class\n",
27
+ "openai = OpenAI(model_name=\"text-davinci-003\")\n",
28
+ "\n",
29
+ "# Get the maximum context size for the model\n",
30
+ "max_context_size = openai.modelname_to_contextsize(openai.model_name)\n",
31
+ "\n",
32
+ "# Set the max_tokens attribute to a value within the model's maximum context length\n",
33
+ "openai.max_tokens = max_context_size - 1 # or any value less than max_context_size\n",
34
+ "\n",
35
+ "# Alternatively, you can use the max_tokens_for_prompt method\n",
36
+ "prompt = \"Tell me a joke.\"*800\n",
37
+ "openai.max_tokens = openai.max_tokens_for_prompt(prompt)\n",
38
+ "openai.max_tokens"
39
  ]
40
  }
41
  ],
tools.py CHANGED
@@ -72,7 +72,7 @@ def nearby_search(input_dict: NearbySearchInput):
72
  """Searches for many places nearby the location based on a keyword. using keyword like \"coffee shop\", \"restaurants\". radius is the range to search from the location."""
73
  print("function call nearby_search", input_dict, "\n")
74
 
75
- max_results = 10
76
  keyword = input_dict['keyword']
77
  location = input_dict['location_name']
78
  radius = input_dict.get('radius', 2000)
 
72
  """Searches for many places nearby the location based on a keyword. using keyword like \"coffee shop\", \"restaurants\". radius is the range to search from the location."""
73
  print("function call nearby_search", input_dict, "\n")
74
 
75
+ max_results = 5
76
  keyword = input_dict['keyword']
77
  location = input_dict['location_name']
78
  radius = input_dict.get('radius', 2000)