Skip to content

Commit

Permalink
fix(agents-api): Implement asyncio boto correctly
Browse files Browse the repository at this point in the history
Signed-off-by: Diwank Singh Tomer <[email protected]>
  • Loading branch information
creatorrr committed Nov 29, 2024
1 parent 5c78198 commit 636ca8e
Show file tree
Hide file tree
Showing 13 changed files with 85 additions and 404 deletions.
1 change: 0 additions & 1 deletion agents-api/agents_api/activities/execute_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
)
from ..autogen.Sessions import CreateSessionRequest
from ..autogen.Tools import SystemDef
from ..common.protocol.remote import RemoteObject
from ..common.protocol.tasks import StepContext
from ..common.storage_handler import auto_blob_store, load_from_blob_store_if_remote
from ..env import testing
Expand Down
6 changes: 0 additions & 6 deletions agents-api/agents_api/activities/task_steps/prompt_step.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
from typing import Callable

from anthropic.types.beta.beta_message import BetaMessage
from beartype import beartype
from langchain_core.tools import BaseTool
from langchain_core.tools.convert import tool as tool_decorator
from litellm.types.utils import ModelResponse
from temporalio import activity
from temporalio.exceptions import ApplicationError
Expand All @@ -16,7 +11,6 @@
from ...common.storage_handler import auto_blob_store
from ...common.utils.template import render_template
from ...env import debug
from ..utils import get_handler_with_filtered_params
from .base_evaluate import base_evaluate

COMPUTER_USE_BETA_FLAG = "computer-use-2024-10-22"
Expand Down
1 change: 0 additions & 1 deletion agents-api/agents_api/autogen/Tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, StrictBool

from .Chat import ChatSettings
from .Common import JinjaTemplate
from .Tools import (
ChosenBash20241022,
ChosenComputer20241022,
Expand Down
310 changes: 0 additions & 310 deletions agents-api/agents_api/autogen/Tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,154 +874,6 @@ class CloudinaryUploadArgumentsUpdate(BaseModel):
"""


class CloudinaryEditArguments(BaseModel):
"""
Arguments for Cloudinary media edit
"""

model_config = ConfigDict(
populate_by_name=True,
)
public_id: str
"""
The file Public ID in Cloudinary
"""
transformation: list[dict[str, Any]]
"""
The transformation to apply to the file
"""
return_base64: StrictBool = False
"""
Return base64 encoded file
"""


class CloudinaryEditArgumentsUpdate(BaseModel):
"""
Arguments for Cloudinary media edit
"""

model_config = ConfigDict(
populate_by_name=True,
)
public_id: str | None = None
"""
The file Public ID in Cloudinary
"""
transformation: list[dict[str, Any]] | None = None
"""
The transformation to apply to the file
"""
return_base64: StrictBool = False
"""
Return base64 encoded file
"""


class CloudinarySetup(BaseModel):
"""
Setup parameters for Cloudinary integration
"""

model_config = ConfigDict(
populate_by_name=True,
)
cloudinary_api_key: str
"""
The API key for Cloudinary
"""
cloudinary_api_secret: str
"""
The API secret for Cloudinary
"""
cloudinary_cloud_name: str
"""
The Cloud name for Cloudinary
"""
params: dict[str, Any] | None = None
"""
Additional parameters for the Cloudinary API
"""


class CloudinarySetupUpdate(BaseModel):
"""
Setup parameters for Cloudinary integration
"""

model_config = ConfigDict(
populate_by_name=True,
)
cloudinary_api_key: str | None = None
"""
The API key for Cloudinary
"""
cloudinary_api_secret: str | None = None
"""
The API secret for Cloudinary
"""
cloudinary_cloud_name: str | None = None
"""
The Cloud name for Cloudinary
"""
params: dict[str, Any] | None = None
"""
Additional parameters for the Cloudinary API
"""


class CloudinaryUploadArguments(BaseModel):
"""
Arguments for Cloudinary media upload
"""

model_config = ConfigDict(
populate_by_name=True,
)
file: str
"""
The URL of the file upload
"""
return_base64: StrictBool = False
"""
Return base64 encoded file
"""
public_id: str | None = None
"""
Optional public ID for the uploaded file
"""
upload_params: dict[str, Any] | None = None
"""
Optional upload parameters
"""


class CloudinaryUploadArgumentsUpdate(BaseModel):
"""
Arguments for Cloudinary media upload
"""

model_config = ConfigDict(
populate_by_name=True,
)
file: str | None = None
"""
The URL of the file upload
"""
return_base64: StrictBool = False
"""
Return base64 encoded file
"""
public_id: str | None = None
"""
Optional public ID for the uploaded file
"""
upload_params: dict[str, Any] | None = None
"""
Optional upload parameters
"""


class Computer20241022Def(BaseModel):
"""
Anthropic new tools
Expand Down Expand Up @@ -1384,94 +1236,6 @@ class FfmpegSearchArgumentsUpdate(BaseModel):
"""


class FfmpegIntegrationDef(BaseIntegrationDef):
"""
Ffmpeg integration definition
"""

model_config = ConfigDict(
populate_by_name=True,
)
provider: Literal["ffmpeg"] = "ffmpeg"
"""
The provider must be "ffmpeg"
"""
method: str | None = None
"""
The specific method of the integration to call
"""
setup: Any | None = None
"""
The setup parameters for Ffmpeg
"""
arguments: FfmpegSearchArguments | None = None
"""
The arguments for Ffmpeg Search
"""


class FfmpegIntegrationDefUpdate(BaseIntegrationDefUpdate):
"""
Ffmpeg integration definition
"""

model_config = ConfigDict(
populate_by_name=True,
)
provider: Literal["ffmpeg"] = "ffmpeg"
"""
The provider must be "ffmpeg"
"""
method: str | None = None
"""
The specific method of the integration to call
"""
setup: Any | None = None
"""
The setup parameters for Ffmpeg
"""
arguments: FfmpegSearchArgumentsUpdate | None = None
"""
The arguments for Ffmpeg Search
"""


class FfmpegSearchArguments(BaseModel):
"""
Arguments for Ffmpeg CMD
"""

model_config = ConfigDict(
populate_by_name=True,
)
cmd: str
"""
The bash command string
"""
file: str | None = None
"""
The base64 string of the file
"""


class FfmpegSearchArgumentsUpdate(BaseModel):
"""
Arguments for Ffmpeg CMD
"""

model_config = ConfigDict(
populate_by_name=True,
)
cmd: str | None = None
"""
The bash command string
"""
file: str | None = None
"""
The base64 string of the file
"""


class FunctionCallOption(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -2586,32 +2350,6 @@ class BaseCloudinaryIntegrationDefUpdate(BaseIntegrationDefUpdate):
method: Literal["media_upload", "media_edit"] | None = None


class BaseCloudinaryIntegrationDef(BaseIntegrationDef):
"""
Base Cloudinary integration definition
"""

model_config = ConfigDict(
populate_by_name=True,
)
provider: Literal["cloudinary"] = "cloudinary"
setup: CloudinarySetup | None = None
method: Literal["media_upload", "media_edit"] | None = None


class BaseCloudinaryIntegrationDefUpdate(BaseIntegrationDefUpdate):
"""
Base Cloudinary integration definition
"""

model_config = ConfigDict(
populate_by_name=True,
)
provider: Literal["cloudinary"] = "cloudinary"
setup: CloudinarySetupUpdate | None = None
method: Literal["media_upload", "media_edit"] | None = None


class BrowserbaseCompleteSessionIntegrationDef(BaseBrowserbaseIntegrationDef):
"""
browserbase complete session integration definition
Expand Down Expand Up @@ -2898,51 +2636,3 @@ class CloudinaryUploadIntegrationDefUpdate(BaseCloudinaryIntegrationDefUpdate):
)
method: Literal["media_upload"] = "media_upload"
arguments: CloudinaryUploadArgumentsUpdate | None = None


class CloudinaryEditIntegrationDef(BaseCloudinaryIntegrationDef):
"""
Cloudinary edit integration definition
"""

model_config = ConfigDict(
populate_by_name=True,
)
method: Literal["media_edit"] = "media_edit"
arguments: CloudinaryEditArguments | None = None


class CloudinaryEditIntegrationDefUpdate(BaseCloudinaryIntegrationDefUpdate):
"""
Cloudinary edit integration definition
"""

model_config = ConfigDict(
populate_by_name=True,
)
method: Literal["media_edit"] = "media_edit"
arguments: CloudinaryEditArgumentsUpdate | None = None


class CloudinaryUploadIntegrationDef(BaseCloudinaryIntegrationDef):
"""
Cloudinary upload integration definition
"""

model_config = ConfigDict(
populate_by_name=True,
)
method: Literal["media_upload"] = "media_upload"
arguments: CloudinaryUploadArguments | None = None


class CloudinaryUploadIntegrationDefUpdate(BaseCloudinaryIntegrationDefUpdate):
"""
Cloudinary upload integration definition
"""

model_config = ConfigDict(
populate_by_name=True,
)
method: Literal["media_upload"] = "media_upload"
arguments: CloudinaryUploadArgumentsUpdate | None = None
Loading

0 comments on commit 636ca8e

Please sign in to comment.