mirror of
https://github.com/dataforcanada/d4c-service-geo-assistant.git
synced 2026-06-13 14:31:01 +02:00
Enable pytest-asyncio tests in CI (#3)
* Set asyncio_mode="auto" in pytest.ini config Xref https://pytest-asyncio.readthedocs.io/en/latest/reference/configuration.html#asyncio-mode * Add test-python GitHub Actions CI workflow * Add `--color=yes` flag to force GitHub Actions logs to have color Xref https://github.com/pytest-dev/pytest/issues/7443 * Refactor contents of test_api.py slightly Using some ruff rules * Delete test_api.py * Make test_get_place async * Make get_place async, and call .ainvoke method on it
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
from typing import Annotated
|
||||
import duckdb
|
||||
import json
|
||||
from langchain_core.tools import tool
|
||||
from langgraph.types import Command
|
||||
from typing import Annotated
|
||||
|
||||
import duckdb
|
||||
from langchain_core.messages import ToolMessage
|
||||
from langchain_core.tools import tool
|
||||
from langchain_core.tools.base import InjectedToolCallId
|
||||
from langgraph.types import Command
|
||||
|
||||
|
||||
def create_database_connection():
|
||||
@@ -15,6 +16,7 @@ def create_database_connection():
|
||||
|
||||
Returns:
|
||||
Configured DuckDB connection
|
||||
|
||||
"""
|
||||
connection = duckdb.connect()
|
||||
connection.execute("INSTALL spatial;")
|
||||
@@ -25,7 +27,7 @@ def create_database_connection():
|
||||
|
||||
|
||||
@tool
|
||||
def get_place(
|
||||
async def get_place(
|
||||
place_name: str, tool_call_id: Annotated[str, InjectedToolCallId] = ""
|
||||
) -> Command:
|
||||
"""Get place location from Overture Maps based on user input place name."""
|
||||
|
||||
Reference in New Issue
Block a user