Skip to content

Commit

Permalink
Merge branch 'dev' into my-feature
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorrr authored Oct 4, 2024
2 parents 1ab83af + a6bcbbe commit 1eb9cea
Show file tree
Hide file tree
Showing 77 changed files with 681 additions and 468 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,17 @@ jobs:
restore-keys: |
${{ runner.os }}-agents-api-poetry-
- name: Cache pytype
uses: actions/cache@v4
with:
path: agents-api/.pytype
key: ${{ runner.os }}-agents-api-pytype-${{ hashFiles('agents-api/**/*.py') }}
restore-keys: |
${{ runner.os }}-agents-api-pytype-
- name: Install dependencies
run: |
cd agents-api
poetry install
- name: Typecheck
run: |
cd agents-api
poetry run poe typecheck
- name: Lint and format
run: |
cd agents-api
poetry run poe format
poetry run poe lint
- name: Run tests
run: |
cd agents-api
poetry run poe test
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "refactor: Lint agents-api (CI)"
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/test-agents-api-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test agents-api
run-name: ${{ github.actor }} is testing the code

# TODO: Fix CI github actions
# SCRUM-26

on: [pull_request]

jobs:
Test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install and configure Poetry
uses: snok/install-poetry@v1

- name: Configure Poetry to use .venv
run: |
cd agents-api
poetry config virtualenvs.in-project true
- name: Cache Poetry virtualenv
uses: actions/cache@v4
with:
path: agents-api/.venv
key: ${{ runner.os }}-agents-api-poetry-${{ hashFiles('agents-api/poetry.lock') }}
restore-keys: |
${{ runner.os }}-agents-api-poetry-
- name: Install dependencies
run: |
cd agents-api
poetry install
- name: Run tests
run: |
cd agents-api
poetry run poe test --fail-limit 1
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
56 changes: 56 additions & 0 deletions .github/workflows/typecheck-agents-api-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Typecheck agents-api
run-name: ${{ github.actor }} is typechecking the code

# TODO: Fix CI github actions
# SCRUM-26

on: [pull_request]

jobs:
Typecheck:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install and configure Poetry
uses: snok/install-poetry@v1

- name: Configure Poetry to use .venv
run: |
cd agents-api
poetry config virtualenvs.in-project true
- name: Cache Poetry virtualenv
uses: actions/cache@v4
with:
path: agents-api/.venv
key: ${{ runner.os }}-agents-api-poetry-${{ hashFiles('agents-api/poetry.lock') }}
restore-keys: |
${{ runner.os }}-agents-api-poetry-
- name: Cache pytype
uses: actions/cache@v4
with:
path: agents-api/.pytype
key: ${{ runner.os }}-agents-api-pytype-${{ github.base_ref }}
restore-keys: |
${{ runner.os }}-agents-api-pytype-
- name: Install dependencies
run: |
cd agents-api
poetry install
- name: Typecheck
run: |
cd agents-api
poetry run poe typecheck
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
2 changes: 1 addition & 1 deletion agents-api/agents_api/activities/truncation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from beartype import beartype
from temporalio import activity

from agents_api.autogen.openapi_model import Entry
from ..autogen.openapi_model import Entry

# from agents_api.models.entry.entries_summarization import get_toplevel_entries_query

Expand Down
7 changes: 7 additions & 0 deletions agents-api/agents_api/autogen/Docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ class Doc(BaseModel):
"""
Contents of the document
"""
embeddings: Annotated[
list[float] | list[list[float]] | None,
Field(None, json_schema_extra={"readOnly": True}),
]
"""
Embeddings for the document
"""


class DocOwner(BaseModel):
Expand Down
31 changes: 0 additions & 31 deletions agents-api/agents_api/autogen/Tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ class CreateToolRequest(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
type: Literal["function", "integration", "system", "api_call"] = "function"
"""
Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now)
"""
name: Annotated[str, Field(max_length=40, pattern="^[^\\W0-9]\\w*$")]
"""
Name of the tool (must be unique for this agent and a valid python identifier string )
Expand Down Expand Up @@ -168,10 +164,6 @@ class NamedToolChoice(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
type: Literal["function", "integration", "system", "api_call"]
"""
Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now)
"""
function: FunctionCallOption | None = None


Expand All @@ -183,10 +175,6 @@ class PatchToolRequest(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
type: Literal["function", "integration", "system", "api_call"] = "function"
"""
Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now)
"""
name: Annotated[str | None, Field(None, max_length=40, pattern="^[^\\W0-9]\\w*$")]
"""
Name of the tool (must be unique for this agent and a valid python identifier string )
Expand Down Expand Up @@ -247,10 +235,6 @@ class Tool(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
type: Literal["function", "integration", "system", "api_call"] = "function"
"""
Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now)
"""
name: Annotated[str, Field(max_length=40, pattern="^[^\\W0-9]\\w*$")]
"""
Name of the tool (must be unique for this agent and a valid python identifier string )
Expand Down Expand Up @@ -291,10 +275,6 @@ class UpdateToolRequest(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
type: Literal["function", "integration", "system", "api_call"] = "function"
"""
Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now)
"""
name: Annotated[str, Field(max_length=40, pattern="^[^\\W0-9]\\w*$")]
"""
Name of the tool (must be unique for this agent and a valid python identifier string )
Expand All @@ -316,14 +296,3 @@ class ChosenFunctionCall(ChosenToolCall):
"""
The function to call
"""


class NamedFunctionChoice(NamedToolChoice):
model_config = ConfigDict(
populate_by_name=True,
)
type: Literal["function"] = "function"
function: FunctionCallOption
"""
The function to call
"""
Loading

0 comments on commit 1eb9cea

Please sign in to comment.