pygeai 0.2.7b36__py3-none-any.whl → 0.2.7b38__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pygeai/core/base/mappers.py +11 -2
- pygeai/core/models.py +20 -11
- pygeai/lab/managers.py +54 -129
- pygeai/organization/responses.py +23 -0
- pygeai/tests/health/__init__.py +0 -0
- pygeai/tests/health/test_clients.py +40 -0
- pygeai/tests/integration/lab/agents/test_create_agent.py +39 -34
- pygeai/tests/integration/lab/agents/test_create_sharing_link.py +101 -0
- pygeai/tests/integration/lab/agents/test_delete_agent.py +100 -0
- pygeai/tests/integration/lab/agents/test_get_agent.py +12 -7
- pygeai/tests/integration/lab/agents/test_publish_agent_revision.py +139 -0
- pygeai/tests/integration/lab/agents/test_update_agent.py +69 -42
- pygeai/tests/lab/test_managers.py +45 -45
- pygeai/tests/organization/test_mappers.py +146 -0
- pygeai/tests/snippets/lab/agents/create_agent.py +1 -5
- pygeai/tests/snippets/lab/agents/create_agent_2.py +1 -5
- pygeai/tests/snippets/lab/agents/delete_agent.py +1 -5
- pygeai/tests/snippets/lab/agents/get_agent.py +2 -11
- pygeai/tests/snippets/lab/agents/get_sharing_link.py +3 -7
- pygeai/tests/snippets/lab/agents/list_agents.py +2 -6
- pygeai/tests/snippets/lab/agents/publish_agent_revision.py +2 -6
- pygeai/tests/snippets/lab/agents/update_agent.py +1 -5
- pygeai/tests/snippets/lab/processes/create_process.py +3 -5
- pygeai/tests/snippets/lab/processes/create_task.py +3 -5
- pygeai/tests/snippets/lab/processes/jobs/list_jobs.py +10 -19
- pygeai/tests/snippets/lab/processes/kbs/create_kb.py +2 -5
- pygeai/tests/snippets/lab/processes/kbs/get_kb.py +10 -16
- pygeai/tests/snippets/lab/processes/kbs/list_kbs.py +13 -20
- pygeai/tests/snippets/lab/processes/kbs/try_all.py +5 -7
- pygeai/tests/snippets/lab/processes/list_processes.py +5 -7
- pygeai/tests/snippets/lab/strategies/create_reasoning_strategy.py +2 -5
- pygeai/tests/snippets/lab/strategies/get_reasoning_strategy.py +2 -5
- pygeai/tests/snippets/lab/strategies/list_reasoning_strategies.py +3 -6
- pygeai/tests/snippets/lab/strategies/update_reasoning_strategy.py +2 -5
- pygeai/tests/snippets/lab/tools/create_tool.py +3 -7
- pygeai/tests/snippets/lab/tools/delete_tool.py +2 -6
- pygeai/tests/snippets/lab/tools/get_parameter.py +5 -7
- pygeai/tests/snippets/lab/tools/get_tool.py +5 -7
- pygeai/tests/snippets/lab/tools/list_tools.py +3 -7
- pygeai/tests/snippets/lab/tools/publish_tool_revision.py +3 -5
- pygeai/tests/snippets/lab/tools/set_parameters.py +4 -9
- pygeai/tests/snippets/lab/tools/update_tool.py +4 -8
- {pygeai-0.2.7b36.dist-info → pygeai-0.2.7b38.dist-info}/METADATA +1 -1
- {pygeai-0.2.7b36.dist-info → pygeai-0.2.7b38.dist-info}/RECORD +48 -42
- {pygeai-0.2.7b36.dist-info → pygeai-0.2.7b38.dist-info}/WHEEL +0 -0
- {pygeai-0.2.7b36.dist-info → pygeai-0.2.7b38.dist-info}/entry_points.txt +0 -0
- {pygeai-0.2.7b36.dist-info → pygeai-0.2.7b38.dist-info}/licenses/LICENSE +0 -0
- {pygeai-0.2.7b36.dist-info → pygeai-0.2.7b38.dist-info}/top_level.txt +0 -0
pygeai/core/base/mappers.py
CHANGED
|
@@ -351,13 +351,22 @@ class ModelMapper:
|
|
|
351
351
|
@classmethod
|
|
352
352
|
def map_to_item(cls, data: dict) -> RequestItem:
|
|
353
353
|
return RequestItem(
|
|
354
|
+
api_token=data.get('apiToken'),
|
|
354
355
|
assistant=data.get('assistant'),
|
|
356
|
+
cost=data.get('cost'),
|
|
357
|
+
elapsed_time_ms=data.get('elapsedTimeMs'),
|
|
358
|
+
end_timestamp=data.get('endTimestamp'),
|
|
359
|
+
feedback=data.get('feedback'),
|
|
355
360
|
intent=data.get('intent'),
|
|
356
|
-
|
|
361
|
+
module=data.get('module'),
|
|
357
362
|
prompt=data.get('prompt'),
|
|
358
363
|
output=data.get('output'),
|
|
359
364
|
input_text=data.get('inputText'),
|
|
360
|
-
|
|
365
|
+
rag_sources_consulted=data.get('ragSourcesConsulted'),
|
|
366
|
+
session_id=data.get('sessionId'),
|
|
367
|
+
start_timestamp=data.get('startTimestamp'),
|
|
368
|
+
status=data.get('status'),
|
|
369
|
+
timestamp=data.get('timestamp')
|
|
361
370
|
)
|
|
362
371
|
|
|
363
372
|
@classmethod
|
pygeai/core/models.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
|
|
3
|
-
from pydantic import Field, field_validator
|
|
3
|
+
from pydantic import Field, field_validator, model_validator
|
|
4
4
|
from typing import Optional, Literal, Any, List, Union, Iterator
|
|
5
5
|
|
|
6
6
|
from pygeai.core import CustomBaseModel
|
|
@@ -247,23 +247,32 @@ class Project(CustomBaseModel):
|
|
|
247
247
|
|
|
248
248
|
class RequestItem(CustomBaseModel):
|
|
249
249
|
"""
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
"intent": "string",
|
|
253
|
-
"timestamp": "string",
|
|
254
|
-
"prompt": "string",
|
|
255
|
-
"output": "string",
|
|
256
|
-
"inputText": "string",
|
|
257
|
-
"status": "string"
|
|
258
|
-
}
|
|
250
|
+
Represents a request item with metadata about an API interaction.
|
|
251
|
+
Follows a JSON schema with camelCase aliases for external compatibility.
|
|
259
252
|
"""
|
|
253
|
+
api_token: str = Field(..., alias="apiToken")
|
|
260
254
|
assistant: str = Field(..., alias="assistant")
|
|
255
|
+
cost: float = Field(..., alias="cost")
|
|
256
|
+
elapsed_time_ms: int = Field(..., alias="elapsedTimeMs")
|
|
257
|
+
end_timestamp: datetime = Field(..., alias="endTimestamp")
|
|
258
|
+
feedback: Optional[str] = Field(None, alias="feedback")
|
|
261
259
|
intent: Optional[str] = Field(None, alias="intent")
|
|
262
|
-
|
|
260
|
+
module: str = Field(..., alias="module")
|
|
263
261
|
prompt: Optional[str] = Field(None, alias="prompt")
|
|
264
262
|
output: Optional[str] = Field(None, alias="output")
|
|
265
263
|
input_text: Optional[str] = Field(None, alias="inputText")
|
|
264
|
+
rag_sources_consulted: Optional[str] = Field(None, alias="ragSourcesConsulted")
|
|
265
|
+
session_id: str = Field(..., alias="sessionId")
|
|
266
|
+
start_timestamp: datetime = Field(..., alias="startTimestamp")
|
|
266
267
|
status: str = Field(..., alias="status")
|
|
268
|
+
timestamp: datetime = Field(..., alias="timestamp")
|
|
269
|
+
|
|
270
|
+
@model_validator(mode="after")
|
|
271
|
+
def validate_status(self):
|
|
272
|
+
valid_statuses = {"succeeded", "failed", "pending"}
|
|
273
|
+
if self.status not in valid_statuses:
|
|
274
|
+
raise ValueError(f"Status must be one of {valid_statuses}")
|
|
275
|
+
return self
|
|
267
276
|
|
|
268
277
|
def to_dict(self):
|
|
269
278
|
return self.model_dump(by_alias=True, exclude_none=True)
|