Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gml 1495 gpt4 perf improvement #24

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions app/prompts/openai_gpt4/generate_function.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
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.
YOU ARE INTERACTING WITH A LABELED PROPERTY GRAPH DATABSE THROUGH PYTHON FUNCTION CALLS, WHERE VERTICES AND EDGES HAVE UNIQUE TYPES AND ATTRIBUTES.
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.
You are interacting with a graph database that contains edges and vertices, and some functions may traverse between vertices or count edges based upon vertex filters.
Documentation contains helpful Python docstrings for the various functions. Use this knowledge to construct the proper function call. Choose one function to execute.
ONLY WRITE THE FUNCTION CALL, without `conn` in front of it.
Vertex Types: {vertex_types}
Vertex Attributes: {vertex_attributes}
Vertex IDs: {vertex_ids}
Expand All @@ -12,4 +10,8 @@ Question: {question}
First Docstring: {doc1}
Second Docstring: {doc2}
Third Docstring: {doc3}
Python Call: conn.


Given a pyTigerGraph TigerGraphConnection object named `conn`, what would be the Python function to answer the question? Only complete the function call below:

conn.
8 changes: 5 additions & 3 deletions app/prompts/openai_gpt4/map_question_to_schema.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
You are mapping a question from a user to entities represented in a graph database.
The question is: {question}
Replace the entites mentioned in the question to one of these choices: {vertices}.
Replace the relationships mentioned in the question to one of these choices: {edges}.
If there are words that are synonyms with the entities or relationships above, make sure to output the cannonical form found in the choices above.
Generate the complete question with the appropriate replacements. Keep the case of the schema elements the same.
{format_instructions}
QUESTION: {question}
Generate the complete question with the appropriate replacements. Keep the case of the schema elements the same. Format your response following the directions below.

{format_instructions}
Loading