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

feat(agents-api): Performance improvements #749

Merged
merged 6 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agents-api/agents_api/autogen/Agents.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# filename: openapi-0.4.0.yaml
# filename: openapi-1.0.0.yaml

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/autogen/Chat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# filename: openapi-0.4.0.yaml
# filename: openapi-1.0.0.yaml

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/autogen/Common.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# filename: openapi-0.4.0.yaml
# filename: openapi-1.0.0.yaml

from __future__ import annotations

Expand Down
49 changes: 32 additions & 17 deletions agents-api/agents_api/autogen/Docs.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# generated by datamodel-codegen:
# filename: openapi-0.4.0.yaml
# filename: openapi-1.0.0.yaml

from __future__ import annotations

from typing import Annotated, Any, Literal
from uuid import UUID

from pydantic import AwareDatetime, BaseModel, ConfigDict, Field
from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, StrictBool


class BaseDocSearchRequest(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
limit: Annotated[int, Field(10, ge=1, le=100)]
limit: Annotated[int, Field(10, ge=1, le=50)]
lang: Literal["en-US"] = "en-US"
"""
The language to be used for text-only search. Support for other languages coming soon.
"""
metadata_filter: dict[str, float | str | StrictBool | None] = {}


class CreateDocRequest(BaseModel):
Expand Down Expand Up @@ -109,20 +110,6 @@ class DocSearchResponse(BaseModel):
"""


class EmbedQueryRequest(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
text: str | list[str]
"""
Text or texts to embed
"""
embed_instruction: str = ""
"""
Instruction for the embedding model.
"""


class EmbedQueryResponse(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -155,6 +142,34 @@ class HybridDocSearchRequest(BaseDocSearchRequest):
"""


class MultipleEmbedQueryRequest(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
text: Annotated[list[str], Field(max_length=100, min_length=1)]
"""
Texts to embed
"""
embed_instruction: str = ""
"""
Instruction for the embedding model.
"""


class SingleEmbedQueryRequest(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
text: str
"""
Text to embed
"""
embed_instruction: str = ""
"""
Instruction for the embedding model.
"""


class Snippet(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/autogen/Entries.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# filename: openapi-0.4.0.yaml
# filename: openapi-1.0.0.yaml

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/autogen/Executions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# filename: openapi-0.4.0.yaml
# filename: openapi-1.0.0.yaml

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/autogen/Jobs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# filename: openapi-0.4.0.yaml
# filename: openapi-1.0.0.yaml

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/autogen/Sessions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# filename: openapi-0.4.0.yaml
# filename: openapi-1.0.0.yaml

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/autogen/Tasks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# filename: openapi-0.4.0.yaml
# filename: openapi-1.0.0.yaml

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/autogen/Tools.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# filename: openapi-0.4.0.yaml
# filename: openapi-1.0.0.yaml

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/autogen/Users.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# filename: openapi-0.4.0.yaml
# filename: openapi-1.0.0.yaml

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/autogen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# generated by datamodel-codegen:
# filename: openapi-0.4.0.yaml
# filename: openapi-1.0.0.yaml
Loading
Loading