Skip to content

Commit 98dfb7e

Browse files
authored
Merge pull request #87 from WorkflowAI/guillaume/add-tenant-uid
Add tenant uid to agent
2 parents fc833af + 7c8ff22 commit 98dfb7e

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

workflowai/core/client/_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ class CreateAgentResponse(BaseModel):
167167
id: str
168168
schema_id: int
169169
uid: int = 0
170+
tenant_uid: int = 0
170171

171172

172173
class ModelMetadata(BaseModel):

workflowai/core/client/_types.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ class AgentInterface(_BaseObject, Generic[AgentInputContra, AgentOutput], Protoc
5757
@property
5858
def agent_uid(self) -> int: ...
5959

60+
@property
61+
def tenant_uid(self) -> int: ...
62+
6063
async def run(
6164
self,
6265
agent_input: AgentInputContra,

workflowai/core/client/agent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ async def register(self):
270270
)
271271
self.schema_id = res.schema_id
272272
self.agent_uid = res.uid
273+
self.tenant_uid = res.tenant_uid
273274
return res.schema_id
274275

275276
@classmethod

workflowai/core/client/agent_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ async def test_auto_register(self, httpx_mock: HTTPXMock, agent_no_schema: Agent
232232
"id": "123",
233233
"schema_id": 2,
234234
"uid": 123,
235+
"tenant_uid": 1234,
235236
},
236237
)
237238
run_response = fixtures_json("task_run.json")
@@ -243,7 +244,7 @@ async def test_auto_register(self, httpx_mock: HTTPXMock, agent_no_schema: Agent
243244
out = await agent_no_schema.run(HelloTaskInput(name="Alice"))
244245
assert out.id == "8f635b73-f403-47ee-bff9-18320616c6cc"
245246
assert agent_no_schema.agent_uid == 123
246-
247+
assert agent_no_schema.tenant_uid == 1234
247248
run_response["id"] = "8f635b73-f403-47ee-bff9-18320616c6cc"
248249
# Try and run again
249250
httpx_mock.add_response(

0 commit comments

Comments
 (0)