diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..f644c0c --- /dev/null +++ b/.env.sample @@ -0,0 +1,18 @@ +# .env.example +# Copy this file as '.env' and fill in the values as described below. +WHYHOW_API_KEY="" + +# OpenAI API Key: A string containing your OpenAI API key for accessing their services. +OPENAI_API_KEY="" + +# Pinecone API Key: A string with your Pinecone API key. +PINECONE_API_KEY="" + +# Neo4J URI: The URI for connecting to your Neo4J database instance. +NEO4J_URI="" + +# Neo4J User: The username for Neo4J database authentication. +NEO4J_USERNAME="" + +# Neo4J Password: The password for Neo4J database authentication. +NEO4J_PASSWORD="" \ No newline at end of file diff --git a/README.md b/README.md index b2d5aa0..af6a26b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Python Version](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/downloads/) [![License](https://img.shields.io/badge/license-MIT-green)](https://opensource.org/licenses/MIT) -[![PyPI Version](https://img.shields.io/pypi/v/whyhow)](https://pypi.org/project/why/) +[![PyPI Version](https://img.shields.io/pypi/v/whyhow)](https://pypi.org/project/whyhow/) [![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Checked with mypy](https://img.shields.io/badge/mypy-checked-blue)](https://mypy-lang.org/) [![Whyhow Discord](https://dcbadge.vercel.app/api/server/9bWqrsxgHr?compact=true&style=flat)](https://discord.gg/9bWqrsxgHr) diff --git a/src/whyhow/__init__.py b/src/whyhow/__init__.py index 9dc34b7..0067ba8 100644 --- a/src/whyhow/__init__.py +++ b/src/whyhow/__init__.py @@ -2,5 +2,5 @@ from whyhow.client import AsyncWhyHow, WhyHow -__version__ = "v0.0.2" +__version__ = "v0.0.3" __all__ = ["AsyncWhyHow", "WhyHow"] diff --git a/src/whyhow/apis/graph.py b/src/whyhow/apis/graph.py index 81f1064..aea183a 100644 --- a/src/whyhow/apis/graph.py +++ b/src/whyhow/apis/graph.py @@ -134,10 +134,6 @@ def query_graph(self, namespace: str, query: str) -> QueryGraphReturn: response = QueryGraphResponse.model_validate(raw_response.json()) - retval = QueryGraphReturn( - answer=response.answer, - cypher_query=response.cypher_query, - context=response.context, - ) + retval = QueryGraphReturn(answer=response.answer) return retval diff --git a/src/whyhow/schemas/graph.py b/src/whyhow/schemas/graph.py index 953b293..f7d922e 100644 --- a/src/whyhow/schemas/graph.py +++ b/src/whyhow/schemas/graph.py @@ -44,15 +44,9 @@ class QueryGraphResponse(BaseResponse): namespace: str answer: str - # triples: list[Triple] - cypher_query: str - context: str class QueryGraphReturn(BaseReturn): """Schema for the return value of the query graph endpoint.""" answer: str - # triples: list[Triple] - cypher_query: str - context: str diff --git a/tests/apis/test_graph.py b/tests/apis/test_graph.py index 3256374..eb845a4 100644 --- a/tests/apis/test_graph.py +++ b/tests/apis/test_graph.py @@ -40,8 +40,6 @@ def test_query_graph(self, httpx_mock): fake_response_body = QueryGraphResponse( namespace="something", answer="Alice knows Bob", - cypher_query="MATCH (p:Person) {p.name: 'Alice'}-[:knows]->(p2:Person) RETURN p2", - context="Alice knows Bob", ) httpx_mock.add_response( method="POST", @@ -53,11 +51,7 @@ def test_query_graph(self, httpx_mock): query=query, ) - assert result == QueryGraphReturn( - answer="Alice knows Bob", - cypher_query="MATCH (p:Person) {p.name: 'Alice'}-[:knows]->(p2:Person) RETURN p2", - context="Alice knows Bob", - ) + assert result == QueryGraphReturn(answer="Alice knows Bob") actual_request = httpx_mock.get_requests()[0] expected_request_body = QueryGraphRequest(query=query) diff --git a/tests/test_client.py b/tests/test_client.py index 13322ac..fb640ee 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -29,7 +29,10 @@ def test_httpx_kwargs(self, monkeypatch): args, kwargs = fake_httpx_client_class.call_args assert not args - assert kwargs["base_url"] == "https://43nq5c1b4c.execute-api.us-east-2.amazonaws.com" + assert ( + kwargs["base_url"] + == "https://43nq5c1b4c.execute-api.us-east-2.amazonaws.com" + ) assert not kwargs["verify"] assert client.httpx_client is fake_httpx_client_class.return_value