Skip to content
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
1 change: 1 addition & 0 deletions workflowai/core/client/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ class CreateAgentResponse(BaseModel):
id: str
schema_id: int
uid: int = 0
tenant_uid: int = 0


class ModelMetadata(BaseModel):
Expand Down
3 changes: 3 additions & 0 deletions workflowai/core/client/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class AgentInterface(_BaseObject, Generic[AgentInputContra, AgentOutput], Protoc
@property
def agent_uid(self) -> int: ...

@property
def tenant_uid(self) -> int: ...

async def run(
self,
agent_input: AgentInputContra,
Expand Down
1 change: 1 addition & 0 deletions workflowai/core/client/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ async def register(self):
)
self.schema_id = res.schema_id
self.agent_uid = res.uid
self.tenant_uid = res.tenant_uid
return res.schema_id

@classmethod
Expand Down
3 changes: 2 additions & 1 deletion workflowai/core/client/agent_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ async def test_auto_register(self, httpx_mock: HTTPXMock, agent_no_schema: Agent
"id": "123",
"schema_id": 2,
"uid": 123,
"tenant_uid": 1234,
},
)
run_response = fixtures_json("task_run.json")
Expand All @@ -243,7 +244,7 @@ async def test_auto_register(self, httpx_mock: HTTPXMock, agent_no_schema: Agent
out = await agent_no_schema.run(HelloTaskInput(name="Alice"))
assert out.id == "8f635b73-f403-47ee-bff9-18320616c6cc"
assert agent_no_schema.agent_uid == 123

assert agent_no_schema.tenant_uid == 1234
run_response["id"] = "8f635b73-f403-47ee-bff9-18320616c6cc"
# Try and run again
httpx_mock.add_response(
Expand Down