Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Julep Developers committed Jun 21, 2024
1 parent d59dda1 commit ef1e969
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion agents-api/agents_api/autogen/openapi_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: openapi.yaml
# timestamp: 2024-06-21T03:09:13+00:00
# timestamp: 2024-06-21T03:13:24+00:00

from __future__ import annotations

Expand Down
9 changes: 7 additions & 2 deletions agents-api/agents_api/common/protocol/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ class ExecutionInput(BaseModel):
arguments: dict[str, Any]

@classmethod
def fetch(cls, *, developer_id: UUID4, task_id: UUID4, execution_id: UUID4, client: Any) -> "ExecutionInput":
def fetch(
cls, *, developer_id: UUID4, task_id: UUID4, execution_id: UUID4, client: Any
) -> "ExecutionInput":
[data] = get_execution_input_query(
task_id=task_id,
execution_id=execution_id,
Expand All @@ -139,7 +141,10 @@ def fetch(cls, *, developer_id: UUID4, task_id: UUID4, execution_id: UUID4, clie
execution = Execution(**data["execution"])
user = User(**data["user"]) if data["user"] else None
session = Session(**data["session"]) if data["session"] else None
tools = [Tool(type="function", id=function["id"], function=FunctionDef(**function)) for function in data["tools"]]
tools = [
Tool(type="function", id=function["id"], function=FunctionDef(**function))
for function in data["tools"]
]
arguments = execution.arguments

return cls(
Expand Down
4 changes: 3 additions & 1 deletion agents-api/agents_api/common/utils/cozo.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@
Client._process_mutate_data(_fake_client, data)
)

uuid_int_list_to_uuid4 = lambda data: UUID(bytes=b"".join([i.to_bytes(1, 'big') for i in data]))
uuid_int_list_to_uuid4 = lambda data: UUID(
bytes=b"".join([i.to_bytes(1, "big") for i in data])
)
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ def _():

result = ExecutionInput.fetch(
developer_id=developer_id,
task_id=task_id, execution_id=execution_id, client=client
task_id=task_id,
execution_id=execution_id,
client=client,
)

assert result.execution.id == execution_id
Expand Down
3 changes: 1 addition & 2 deletions agents-api/agents_api/routers/tasks/routers.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ async def create_task(

workflows = [
{"name": "main", "steps": request.main},
] + [{"name": name, "steps": steps} for name, steps in request.model_extra
]
] + [{"name": name, "steps": steps} for name, steps in request.model_extra]

resp: pd.DataFrame = create_task_query(
agent_id=agent_id,
Expand Down
4 changes: 2 additions & 2 deletions mock_openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2773,10 +2773,10 @@ components:
default: null
created_at:
type: string
format: uuid
format: date-time
updated_at:
type: string
format: uuid
format: date-time
required:
- id
- task_id
Expand Down
2 changes: 1 addition & 1 deletion sdks/postman/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -3784,7 +3784,7 @@
"body": null
},
"description": "",
"body": "[\n {\n \"id\": \"id\",\n \"task_id\": \"task_id\",\n \"status\": \"status\",\n \"arguments\": {\n \"arguments\": {\n \"key\": \"value\"\n }\n },\n \"user_id\": \"user_id\",\n \"session_id\": \"session_id\",\n \"created_at\": \"created_at\",\n \"updated_at\": \"updated_at\"\n }\n]",
"body": "[\n {\n \"id\": \"id\",\n \"task_id\": \"task_id\",\n \"status\": \"status\",\n \"arguments\": {\n \"arguments\": {\n \"key\": \"value\"\n }\n },\n \"user_id\": \"user_id\",\n \"session_id\": \"session_id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n]",
"_postman_previewlanguage": "json"
}
]
Expand Down
4 changes: 2 additions & 2 deletions sdks/python/julep/api/types/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class Execution(pydantic.BaseModel):
)
user_id: typing.Optional[str]
session_id: typing.Optional[str]
created_at: str
updated_at: str
created_at: dt.datetime
updated_at: dt.datetime

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {
Expand Down

0 comments on commit ef1e969

Please sign in to comment.