Skip to content

Commit

Permalink
GML-1824 modify the prompt to make sure always generate count found w…
Browse files Browse the repository at this point in the history
…hen asking how many
  • Loading branch information
Lu Zhou authored and Lu Zhou committed Jul 18, 2024
1 parent bd35e71 commit 7061aef
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions common/prompts/aws_bedrock_claude3haiku/generate_function.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Use the vertex types, edge types, and their attributes and IDs below to write the pyTigerGraph function call to answer the question using a pyTigerGraph connection.
When the question asks for "How many", make sure to select a function that contains "Count" in the description/function call. Make sure never to generate a function that is not listed below.
When the question asks for "How many", make sure to always select a function that contains "Count" in the description/function call. Make sure never to generate a function that is not listed below.
When certain entities are mapped to vertex attributes, may consider to generate a WHERE clause.
If a WHERE clause is generated, please follow the instruction with proper quoting. To construct a WHERE clause string. Ensure that string attribute values are properly quoted.
For example, if the generated function is "conn.getVertices('Person', where='name=William Torres')", Expected Output: "conn.getVertices('Person', where='name="William Torres"')", This rule applies to all types of attributes. e.g., name, email, address and so on.
For example, if the generated function contains "('Person', where='name=William Torres')", Expected Output: "('Person', where='name="William Torres"')", This rule applies to all types of attributes. e.g., name, email, address and so on.
Documentation contains helpful Python docstrings for the various functions. Use this knowledge to construct the proper function call. Choose one function to execute.
Don't generate target_vertex_ids if there is no the term 'id' explicitly mentioned in the question.
Vertex Types: {vertex_types}
Expand Down
3 changes: 2 additions & 1 deletion common/prompts/aws_bedrock_titan/generate_function.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Use the vertex types, edge types, and their attributes and IDs to write the pyTigerGraph function call to answer the question using a pyTigerGraph connection.
When the question asks for "How many", make sure to always select a function that contains "Count" in the description/function call. Make sure never to generate a function that is not listed below.
When certain entities are mapped to vertex attributes, may consider to generate a WHERE clause.
If a WHERE clause is generated, please follow the instruction with proper quoting. To construct a WHERE clause string. Ensure that string attribute values are properly quoted.
For example, if the generated function is "conn.getVertices('Person', where='name=William Torres')", Expected Output: "conn.getVertices('Person', where='name="William Torres"')", This rule applies to all types of attributes. e.g., name, email, address and so on.
For example, if the generated function contains "('Person', where='name=William Torres')", Expected Output: "('Person', where='name="William Torres"')", This rule applies to all types of attributes. e.g., name, email, address and so on.
Documentation contains helpful Python docstrings for the various functions. Use this knowledge to construct the proper function call. Choose one function to execute.
Don't generate target_vertex_ids if there is no the term 'id' explicitly mentioned in the question.
Vertex Types: {vertices}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Use the vertex types, edge types, and their attributes and IDs below to write the pyTigerGraph function call to answer the question using a pyTigerGraph connection.
When the question asks for "How many", make sure to select a function that contains "Count" in the description/function call. Make sure never to generate a function that is not listed below.
When the question asks for "How many", make sure to always select a function that contains "Count" in the description/function call. Make sure never to generate a function that is not listed below.
When certain entities are mapped to vertex attributes, may consider to generate a WHERE clause.
If a WHERE clause is generated, please follow the instruction with proper quoting. To construct a WHERE clause string. Ensure that string attribute values are properly quoted.
For example, if the generated function is "conn.getVertices('Person', where='name=William Torres')", Expected Output: "conn.getVertices('Person', where='name="William Torres"')", This rule applies to all types of attributes. e.g., name, email, address and so on.
For example, if the generated function contains "('Person', where='name=William Torres')", Expected Output: "('Person', where='name="William Torres"')", This rule applies to all types of attributes. e.g., name, email, address and so on.
Documentation contains helpful Python docstrings for the various functions. Use this knowledge to construct the proper function call. Choose one function to execute.
Don't generate target_vertex_ids if there is no the term 'id' explicitly mentioned in the question.

Expand Down
4 changes: 2 additions & 2 deletions common/prompts/gcp_vertexai_palm/generate_function.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Use the vertex types, edge types, and their attributes and IDs below to write the pyTigerGraph function call to answer the question using a pyTigerGraph connection.
When the question asks for "How many", make sure to select a function that contains "Count" in the description/function call. Make sure never to generate a function that is not listed below.
When the question asks for "How many", make sure to always select a function that contains "Count" in the description/function call. Make sure never to generate a function that is not listed below.
When certain entities are mapped to vertex attributes, may consider to generate a WHERE clause.
If a WHERE clause is generated, please follow the instruction with proper quoting. To construct a WHERE clause string. Ensure that string attribute values are properly quoted.
For example, if the generated function is "conn.getVertices('Person', where='name=William Torres')", Expected Output: "conn.getVertices('Person', where='name="William Torres"')", This rule applies to all types of attributes. e.g., name, email, address and so on.
For example, if the generated function contains "('Person', where='name=William Torres')", Expected Output: "('Person', where='name="William Torres"')", This rule applies to all types of attributes. e.g., name, email, address and so on.
Documentation contains helpful Python docstrings for the various functions. Use this knowledge to construct the proper function call. Choose one function to execute.
Don't generate target_vertex_ids if there is no the term 'id' explicitly mentioned in the question.

Expand Down
4 changes: 2 additions & 2 deletions common/prompts/llama_70b/generate_function.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Use the vertex types, edge types, and their attributes and IDs below to write the pyTigerGraph function call to answer the question using a pyTigerGraph connection.
When the question asks for "How many", make sure to select a function that contains "Count" in the description/function call. Make sure never to generate a function that is not listed below.
When the question asks for "How many", make sure to always select a function that contains "Count" in the description/function call. Make sure never to generate a function that is not listed below.
When certain entities are mapped to vertex attributes, may consider to generate a WHERE clause.
If a WHERE clause is generated, please follow the instruction with proper quoting. To construct a WHERE clause string. Ensure that string attribute values are properly quoted.
For example, if the generated function is "conn.getVertices('Person', where='name=William Torres')", Expected Output: "conn.getVertices('Person', where='name="William Torres"')", This rule applies to all types of attributes. e.g., name, email, address and so on.
For example, if the generated function contains "('Person', where='name=William Torres')", Expected Output: "('Person', where='name="William Torres"')", This rule applies to all types of attributes. e.g., name, email, address and so on.
Documentation contains helpful Python docstrings for the various functions. Use this knowledge to construct the proper function call. Choose one function to execute.
Don't generate target_vertex_ids if there is no the term 'id' explicitly mentioned in the question.
Vertex Types: {vertex_types}
Expand Down
4 changes: 2 additions & 2 deletions common/prompts/openai_gpt4/generate_function.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Use the vertex types, edge types, and their attributes and IDs below to write the pyTigerGraph function call to answer the question using a pyTigerGraph connection.
When the question asks for "How many", make sure to select a function that contains "Count" in the description/function call. Make sure never to generate a function that is not listed below.
When the question asks for "How many", make sure to always select a function that contains "Count" in the description/function call. Make sure never to generate a function that is not listed below.
When certain entities are mapped to vertex attributes, may consider to generate a WHERE clause.
If a WHERE clause is generated, please follow the instruction with proper quoting. To construct a WHERE clause string. Ensure that string attribute values are properly quoted.
For example, if the generated function is "conn.getVertices('Person', where='name=William Torres')", Expected Output: "conn.getVertices('Person', where='name="William Torres"')", This rule applies to all types of attributes. e.g., name, email, address and so on.
For example, if the generated function contains "('Person', where='name=William Torres')", Expected Output: "('Person', where='name="William Torres"')", This rule applies to all types of attributes. e.g., name, email, address and so on.
Documentation contains helpful Python docstrings for the various functions. Use this knowledge to construct the proper function call. Choose one function to execute.
Don't generate target_vertex_ids if there is no the term 'id' explicitly mentioned in the question.
Vertex Types: {vertex_types}
Expand Down
2 changes: 1 addition & 1 deletion copilot/app/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def question_for_agent(
for output in self.agent.stream({"question": input_data["input"], "conversation": input_data["conversation"]}):

for key, value in output.items():
# logger.info(f"testing steps {key}: {value}")
logger.info(f"testing steps {key}: {value}")
LogWriter.info(f"request_id={req_id_cv.get()} executed node {key}")

LogWriter.info(f"request_id={req_id_cv.get()} EXIT question_for_agent")
Expand Down

0 comments on commit 7061aef

Please sign in to comment.