diff --git a/.github/workflows/lint-and-format.yml b/.github/workflows/lint-and-format.yml new file mode 100644 index 000000000..dcac9ec98 --- /dev/null +++ b/.github/workflows/lint-and-format.yml @@ -0,0 +1,19 @@ +name: Lint and format APIs and SDKs +run-name: ${{ github.actor }} is linting and formatting the code +on: [push, pull_request] +jobs: + Lint-And-Format-APIs-And-SDKs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Install and configure Poetry + uses: snok/install-poetry@v1 + - name: Lint and format Agents API + run: cd agents-api && poetry install && poetry run poe check + - name: Lint and format Models API + run: cd model-serving && poetry install && poetry run poe check + - name: Lint and format Python SDK + run: cd sdks/python && poetry install && poetry run poe check diff --git a/agents-api/agents_api/models/agent/create_tools.py b/agents-api/agents_api/models/agent/create_tools.py index ad85d8549..4496b3747 100644 --- a/agents-api/agents_api/models/agent/create_tools.py +++ b/agents-api/agents_api/models/agent/create_tools.py @@ -31,7 +31,7 @@ def create_tools_query( functions_input: list[list] = [] for function, embedding in zip(functions, embeddings): - parameters = function.parameters.model_dump_json() + parameters = function.parameters.model_dump() functions_input.append( [ str(agent_id), diff --git a/agents-api/agents_api/models/entry/proc_mem_context.py b/agents-api/agents_api/models/entry/proc_mem_context.py index 4c958eded..5c91ed980 100644 --- a/agents-api/agents_api/models/entry/proc_mem_context.py +++ b/agents-api/agents_api/models/entry/proc_mem_context.py @@ -133,17 +133,24 @@ def proc_mem_context_query( # Search for tools ?[role, name, content, token_count, created_at, index] := *_input{{agent_id, tool_query}}, - ~agent_functions:embedding_space {{ + # ~agent_functions:embedding_space {{ + # agent_id, + # name: fn_name, + # description, + # parameters, + # updated_at: created_at | + # query: tool_query, + # k: $k_tools, + # ef: 128, + # radius: $tools_radius, + # bind_distance: distance, + # }}, + *agent_functions {{ agent_id, name: fn_name, description, parameters, - updated_at: created_at | - query: tool_query, - k: $k_tools, - ef: 128, - radius: $tools_radius, - bind_distance: distance, + updated_at: created_at, }}, role = "system",