Skip to content

Commit

Permalink
feat: Email provider integration tool (#602)
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorrr authored Oct 7, 2024
1 parent 0b8e2d7 commit 46c0a23
Show file tree
Hide file tree
Showing 21 changed files with 394 additions and 582 deletions.
70 changes: 0 additions & 70 deletions agents-api/agents_api/autogen/Tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, StrictBool

from .Chat import ChatSettings
from .Docs import (
EmbedQueryRequest,
HybridDocSearchRequest,
TextOnlyDocSearchRequest,
VectorDocSearchRequest,
)
from .Tools import CreateToolRequest, NamedToolChoice


Expand All @@ -33,8 +27,6 @@ class CaseThen(BaseModel):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| YieldStep
| ReturnStep
| SleepStep
Expand All @@ -61,8 +53,6 @@ class CaseThenUpdateItem(BaseModel):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| YieldStep
| ReturnStep
| SleepStep
Expand Down Expand Up @@ -128,8 +118,6 @@ class CreateTaskRequest(BaseModel):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| YieldStep
| ReturnStep
| SleepStep
Expand Down Expand Up @@ -161,22 +149,6 @@ class CreateTaskRequest(BaseModel):
metadata: dict[str, Any] | None = None


class EmbedStep(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
kind_: Annotated[
Literal["embed"], Field("embed", json_schema_extra={"readOnly": True})
]
"""
The kind of step
"""
embed: EmbedQueryRequest
"""
The text to embed
"""


class ErrorWorkflowStep(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -225,8 +197,6 @@ class ForeachDo(BaseModel):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| YieldStep
)
"""
Expand All @@ -250,8 +220,6 @@ class ForeachDoUpdateItem(BaseModel):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| YieldStep
)
"""
Expand Down Expand Up @@ -324,8 +292,6 @@ class IfElseWorkflowStep(BaseModel):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| YieldStep
| ReturnStep
| SleepStep
Expand All @@ -342,8 +308,6 @@ class IfElseWorkflowStep(BaseModel):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| YieldStep
| ReturnStep
| SleepStep
Expand Down Expand Up @@ -376,8 +340,6 @@ class IfElseWorkflowStepUpdateItem(BaseModel):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| YieldStep
| ReturnStep
| SleepStep
Expand All @@ -394,8 +356,6 @@ class IfElseWorkflowStepUpdateItem(BaseModel):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| YieldStep
| ReturnStep
| SleepStep
Expand Down Expand Up @@ -462,8 +422,6 @@ class Main(BaseModel):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| YieldStep
)
"""
Expand Down Expand Up @@ -504,8 +462,6 @@ class MainModel(BaseModel):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| YieldStep
)
"""
Expand Down Expand Up @@ -545,8 +501,6 @@ class ParallelStep(BaseModel):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| YieldStep
],
Field(max_length=100),
Expand All @@ -572,8 +526,6 @@ class ParallelStepUpdateItem(BaseModel):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| YieldStep
],
Field(max_length=100),
Expand All @@ -600,8 +552,6 @@ class PatchTaskRequest(BaseModel):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| YieldStep
| ReturnStep
| SleepStep
Expand Down Expand Up @@ -762,22 +712,6 @@ class ReturnStep(BaseModel):
"""


class SearchStep(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
kind_: Annotated[
Literal["search"], Field("search", json_schema_extra={"readOnly": True})
]
"""
The kind of step
"""
search: VectorDocSearchRequest | TextOnlyDocSearchRequest | HybridDocSearchRequest
"""
The search query
"""


class SetStep(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -878,8 +812,6 @@ class Task(BaseModel):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| YieldStep
| ReturnStep
| SleepStep
Expand Down Expand Up @@ -1013,8 +945,6 @@ class UpdateTaskRequest(BaseModel):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| YieldStep
| ReturnStep
| SleepStep
Expand Down
2 changes: 2 additions & 0 deletions agents-api/agents_api/autogen/Tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ class IntegrationDef(BaseModel):
"spider",
"brave",
"browserbase",
"email",
]
| str
)
Expand Down Expand Up @@ -260,6 +261,7 @@ class IntegrationDefUpdate(BaseModel):
"spider",
"brave",
"browserbase",
"email",
]
| str
| None
Expand Down
5 changes: 0 additions & 5 deletions agents-api/agents_api/autogen/openapi_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
computed_field,
field_validator,
model_validator,
validator,
)

from ..common.utils.datetime import utcnow
Expand Down Expand Up @@ -401,8 +400,6 @@ def from_model_input(
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| ReturnStep
| SleepStep
| ErrorWorkflowStep
Expand Down Expand Up @@ -475,8 +472,6 @@ class Task(_Task):
| GetStep
| SetStep
| LogStep
| EmbedStep
| SearchStep
| ReturnStep
| SleepStep
| ErrorWorkflowStep
Expand Down
16 changes: 0 additions & 16 deletions agents-api/agents_api/workflows/task_execution/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from ...activities.execute_system import execute_system
from ...autogen.openapi_model import (
ApiCallDef,
EmbedStep,
ErrorWorkflowStep,
EvaluateStep,
ForeachDo,
Expand All @@ -29,7 +28,6 @@
ParallelStep,
PromptStep,
ReturnStep,
SearchStep,
SetStep,
SleepFor,
SleepStep,
Expand Down Expand Up @@ -72,8 +70,6 @@
# | GetStep # ✅
# | SetStep # ✅
# | LogStep # ✅
# | EmbedStep # ❌
# | SearchStep # ❌
# | ReturnStep # ✅
# | SleepStep # ✅
# | ErrorWorkflowStep # ✅
Expand Down Expand Up @@ -455,18 +451,6 @@ async def run(

state = PartialTransition(output=value)

case EmbedStep(), _:
# FIXME: Implement EmbedStep
# SCRUM-19
workflow.logger.error("EmbedStep not yet implemented")
raise ApplicationError("Not implemented")

case SearchStep(), _:
# FIXME: Implement SearchStep
# SCRUM-18
workflow.logger.error("SearchStep not yet implemented")
raise ApplicationError("Not implemented")

case ParallelStep(), _:
# FIXME: Implement ParallelStep
# SCRUM-17
Expand Down
Loading

0 comments on commit 46c0a23

Please sign in to comment.