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

Update pytests #52

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
- 11434:11434
volumes:
- ollama:/root/.ollama

strategy:
matrix:
model: [gemini/gemini-2.0-flash-exp, openai/gpt-4o] # List of models

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -73,4 +77,6 @@ jobs:
REGION: ${{ vars.REGION }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
TEST_MODEL: ${{ matrix.model }} # Pass the model as an environment variable
run: poetry run pytest
10 changes: 3 additions & 7 deletions graphrag_sdk/fixtures/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,9 @@


For example, given the question "Which managers own Neo4j stocks?", the OpenCypher statement should look like this:
```
MATCH (m:Manager)-[:OWNS]->(s:Stock)
WHERE s.name CONTAINS 'Neo4j'
RETURN m, s
```
"""
RETURN m, s"""

CYPHER_GEN_PROMPT = """
Using the ontology provided, generate an OpenCypher statement to query the graph database returning all relevant entities, relationships, and attributes to answer the question below.
Expand All @@ -447,7 +444,7 @@
Please think if your answer is a valid Cypher query, and correct it if it is not.

Question: {question}
"""
Your generated Cypher: """


CYPHER_GEN_PROMPT_WITH_ERROR = """
Expand All @@ -472,9 +469,8 @@
Respect the order of the relationships; the arrows should always point from the "source" to the "target".

Last Answer: {last_answer}

Question: {question}
"""
Your generated Cypher: """

GRAPH_QA_SYSTEM = """
You are an assistant that helps to form nice and human understandable answers.
Expand Down
2 changes: 1 addition & 1 deletion graphrag_sdk/models/litellm.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def check_valid_key(self, model: str):
model=model, messages=messages, max_tokens=10
)
return True
except:
except Exception as e:
return False

def check_and_pull_model(self) -> None:
Expand Down
Loading