vonliechti commited on
Commit
5f43612
·
verified ·
1 Parent(s): 46be4de

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. tools/squad_tools.py +5 -7
tools/squad_tools.py CHANGED
@@ -4,14 +4,13 @@ from data import get_data
4
  class SquadRetrieverTool(Tool):
5
  name = "squad_retriever"
6
  description = """Retrieves documents from the Stanford Question Answering Dataset (SQuAD).
7
- Because this tool does not remember context from previous queries, be sure to include any
8
- relevant context in your query. Also, this tool only looks for affirmative matches, and does
9
- not support negative queries, so only query for what you want, not what you don't want.
10
  """
11
  inputs = {
12
  "query": {
13
  "type": "string",
14
- "description": "The query. This could be the literal question being asked by the user, modified to be informed by your goals and chat history. Be sure to pass this as a keyword argument and not a dictionary.",
15
  },
16
  }
17
  output_type = "string"
@@ -40,11 +39,11 @@ class SquadQueryTool(Tool):
40
  name = "squad_query"
41
  description = """Attempts to answer a question using the Stanford Question Answering Dataset (SQuAD).
42
  Because this tool does not remember context from previous queries, be sure to include
43
- any relevant context in your query."""
44
  inputs = {
45
  "query": {
46
  "type": "string",
47
- "description": "The question. This should be the literal question being asked, only modified to be informed by your goals and chat history. Be sure to pass this as a keyword argument and not a dictionary.",
48
  },
49
  }
50
  output_type = "string"
@@ -58,7 +57,6 @@ class SquadQueryTool(Tool):
58
  assert isinstance(query, str), "Your search query must be a string"
59
 
60
  response = self.query_engine.query(query)
61
- # docs = self.data.index.similarity_search(query, k=3)
62
 
63
  if len(response.response) == 0:
64
  return "No answer found for this query."
 
4
  class SquadRetrieverTool(Tool):
5
  name = "squad_retriever"
6
  description = """Retrieves documents from the Stanford Question Answering Dataset (SQuAD).
7
+ Because this tool does not remember context from previous queries, be sure to include
8
+ as many details as possible in your query.
 
9
  """
10
  inputs = {
11
  "query": {
12
  "type": "string",
13
+ "description": "The query. Be sure to pass this as a keyword argument and not a dictionary.",
14
  },
15
  }
16
  output_type = "string"
 
39
  name = "squad_query"
40
  description = """Attempts to answer a question using the Stanford Question Answering Dataset (SQuAD).
41
  Because this tool does not remember context from previous queries, be sure to include
42
+ as many details as possible in your query."""
43
  inputs = {
44
  "query": {
45
  "type": "string",
46
+ "description": "The question. Be sure to pass this as a keyword argument and not a dictionary.",
47
  },
48
  }
49
  output_type = "string"
 
57
  assert isinstance(query, str), "Your search query must be a string"
58
 
59
  response = self.query_engine.query(query)
 
60
 
61
  if len(response.response) == 0:
62
  return "No answer found for this query."