seekrai 0.5.15__py3-none-any.whl → 0.5.16__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.
@@ -19,7 +19,8 @@ class AgentInference:
19
19
  stream: bool = False,
20
20
  model_settings: ModelSettings = ModelSettings(),
21
21
  response_format: Optional[Any] = None,
22
- group: Optional[str] = None,
22
+ group: Optional[str] = "default_group",
23
+ metadata: Optional[dict[str, str]] = None,
23
24
  ) -> Union[RunResponse, Iterator[Any]]:
24
25
  """
25
26
  Run an inference call on a deployed agent.
@@ -30,7 +31,8 @@ class AgentInference:
30
31
  stream (bool, optional): Whether to stream the response. Defaults to False.
31
32
  model_settings (optional): Additional parameters (such as temperature, max_tokens, etc).
32
33
  response_format: Optional structured output specification. If provided, the LLM will be constrained to return JSON matching this schema.
33
- group (str, optional): Label used to associate a group of runs. Defaults to None.
34
+ group (str, optional): Label used to associate a group of runs. Defaults to 'default_group'.
35
+ metadata (dict[str, str], optional): Additional metadata used to label runs. Defaults to None.
34
36
 
35
37
  Returns:
36
38
  A dictionary with the response (if non-streaming) or an iterator over response chunks.
@@ -42,6 +44,7 @@ class AgentInference:
42
44
  if response_format
43
45
  else None,
44
46
  group=group,
47
+ metadata=metadata,
45
48
  ).model_dump()
46
49
  endpoint = f"threads/{thread_id}/runs"
47
50
  if stream:
@@ -159,7 +162,8 @@ class AsyncAgentInference:
159
162
  stream: bool = False,
160
163
  model_settings: ModelSettings = ModelSettings(),
161
164
  response_format: Optional[Any] = None,
162
- group: Optional[str] = None,
165
+ group: Optional[str] = "default_group",
166
+ metadata: Optional[dict[str, str]] = None,
163
167
  ) -> Union[RunResponse, AsyncGenerator[Any, None]]:
164
168
  """
165
169
  Run an inference call on a deployed agent.
@@ -170,7 +174,8 @@ class AsyncAgentInference:
170
174
  stream (bool, optional): Whether to stream the response. Defaults to False.
171
175
  model_settings (optional): Additional parameters (such as temperature, max_tokens, etc).
172
176
  response_format: Optional structured output specification. If provided, the LLM will be constrained to return JSON matching this schema.
173
- group (str, optional): Label used to associate a group of runs. Defaults to None.
177
+ group (str, optional): Label used to associate a group of runs. Defaults to 'default_group'.
178
+ metadata (dict[str, str], optional): Additional metadata used to label runs. Defaults to None.
174
179
 
175
180
  Returns:
176
181
  A dictionary with the response (if non-streaming) or an iterator over response chunks.
@@ -182,6 +187,7 @@ class AsyncAgentInference:
182
187
  if response_format
183
188
  else None,
184
189
  group=group,
190
+ metadata=metadata,
185
191
  ).model_dump()
186
192
  endpoint = f"threads/{thread_id}/runs"
187
193
  if stream:
@@ -27,6 +27,7 @@ class AgentObservability:
27
27
  trace_id: Optional[str] = None,
28
28
  thread_id: Optional[str] = None,
29
29
  group: Optional[str] = None,
30
+ metadata: Optional[dict[str, str]] = None,
30
31
  limit: int = 100,
31
32
  order: str = "desc",
32
33
  offset: int = 0,
@@ -42,6 +43,7 @@ class AgentObservability:
42
43
  trace_id=trace_id,
43
44
  thread_id=thread_id,
44
45
  group=group,
46
+ metadata=metadata,
45
47
  limit=limit,
46
48
  order=order,
47
49
  offset=offset,
@@ -86,6 +88,7 @@ class AsyncAgentObservability:
86
88
  trace_id: Optional[str] = None,
87
89
  thread_id: Optional[str] = None,
88
90
  group: Optional[str] = None,
91
+ metadata: Optional[dict[str, str]] = None,
89
92
  limit: int = 100,
90
93
  order: str = "desc",
91
94
  offset: int = 0,
@@ -101,6 +104,7 @@ class AsyncAgentObservability:
101
104
  trace_id=trace_id,
102
105
  thread_id=thread_id,
103
106
  group=group,
107
+ metadata=metadata,
104
108
  limit=limit,
105
109
  order=order,
106
110
  offset=offset,
@@ -17,15 +17,12 @@ class CustomFunctions:
17
17
  client=self._client,
18
18
  )
19
19
 
20
- def create(
21
- self, file_path: Union[str, Path], description: Union[str, None] = None
22
- ) -> PythonFunctionResponse:
20
+ def create(self, file_path: Union[str, Path]) -> PythonFunctionResponse:
23
21
  """
24
22
  Upload a new Python function for the user.
25
23
 
26
24
  Args:
27
25
  file_path: Path to the Python function file to upload (can be relative or absolute).
28
- description: Optional description for the function.
29
26
 
30
27
  Returns:
31
28
  The newly created Python function.
@@ -40,16 +37,12 @@ class CustomFunctions:
40
37
 
41
38
  # Prepare multipart form data
42
39
  files = {"file": (file_path.name, file_content, "text/plain")}
43
- params = {}
44
- if description:
45
- params["description"] = description
46
40
 
47
41
  response, _, _ = self._requestor.request(
48
42
  options=SeekrFlowRequest(
49
43
  method="POST",
50
44
  url="functions/",
51
45
  files=files,
52
- params=params,
53
46
  ),
54
47
  )
55
48
 
@@ -103,10 +96,7 @@ class CustomFunctions:
103
96
  return functions
104
97
 
105
98
  def update(
106
- self,
107
- function_id: str,
108
- file_path: Union[str, Path, None] = None,
109
- description: Union[str, None] = None,
99
+ self, function_id: str, file_path: Union[str, Path]
110
100
  ) -> PythonFunctionResponse:
111
101
  """
112
102
  Update an existing Python function.
@@ -119,30 +109,22 @@ class CustomFunctions:
119
109
  Returns:
120
110
  The updated Python function.
121
111
  """
122
- files = None
123
- params = {}
124
-
125
- if file_path:
126
- # Convert string to Path if needed
127
- if isinstance(file_path, str):
128
- file_path = Path(file_path)
129
-
130
- # Read the file contents
131
- with file_path.open("rb") as f:
132
- file_content = f.read()
112
+ # Convert string to Path if needed
113
+ if isinstance(file_path, str):
114
+ file_path = Path(file_path)
133
115
 
134
- # Prepare multipart form data
135
- files = {"file": (file_path.name, file_content, "text/plain")}
116
+ # Read the file contents
117
+ with file_path.open("rb") as f:
118
+ file_content = f.read()
136
119
 
137
- if description:
138
- params["description"] = description
120
+ # Prepare multipart form data
121
+ files = {"file": (file_path.name, file_content, "text/plain")}
139
122
 
140
123
  response, _, _ = self._requestor.request(
141
124
  options=SeekrFlowRequest(
142
125
  method="PATCH",
143
126
  url=f"functions/{function_id}",
144
127
  files=files,
145
- params=params,
146
128
  ),
147
129
  )
148
130
 
@@ -177,15 +159,12 @@ class AsyncCustomFunctions:
177
159
  client=self._client,
178
160
  )
179
161
 
180
- async def create(
181
- self, file_path: Union[str, Path], description: Union[str, None] = None
182
- ) -> PythonFunctionResponse:
162
+ async def create(self, file_path: Union[str, Path]) -> PythonFunctionResponse:
183
163
  """
184
164
  Upload a new Python function for the user.
185
165
 
186
166
  Args:
187
167
  file_path: Path to the Python function file to upload (can be relative or absolute).
188
- description: Optional description for the function.
189
168
 
190
169
  Returns:
191
170
  The newly created Python function.
@@ -200,16 +179,12 @@ class AsyncCustomFunctions:
200
179
 
201
180
  # Prepare multipart form data
202
181
  files = {"file": (file_path.name, file_content, "text/plain")}
203
- params = {}
204
- if description:
205
- params["description"] = description
206
182
 
207
183
  response, _, _ = await self._requestor.arequest(
208
184
  options=SeekrFlowRequest(
209
185
  method="POST",
210
186
  url="functions/",
211
187
  files=files,
212
- params=params,
213
188
  ),
214
189
  )
215
190
 
@@ -265,44 +240,34 @@ class AsyncCustomFunctions:
265
240
  async def update(
266
241
  self,
267
242
  function_id: str,
268
- file_path: Union[str, Path, None] = None,
269
- description: Union[str, None] = None,
243
+ file_path: Union[str, Path],
270
244
  ) -> PythonFunctionResponse:
271
245
  """
272
246
  Update an existing Python function.
273
247
 
274
248
  Args:
275
249
  function_id: The ID of the Python function to update.
276
- file_path: Optional path to a new Python function file (can be relative or absolute).
277
- description: Optional new description for the function.
250
+ file_path: Path to a new Python function file (can be relative or absolute).
278
251
 
279
252
  Returns:
280
253
  The updated Python function.
281
254
  """
282
- files = None
283
- params = {}
284
-
285
- if file_path:
286
- # Convert string to Path if needed
287
- if isinstance(file_path, str):
288
- file_path = Path(file_path)
289
-
290
- # Read the file contents
291
- with file_path.open("rb") as f:
292
- file_content = f.read()
255
+ # Convert string to Path if needed
256
+ if isinstance(file_path, str):
257
+ file_path = Path(file_path)
293
258
 
294
- # Prepare multipart form data
295
- files = {"file": (file_path.name, file_content, "text/plain")}
259
+ # Read the file contents
260
+ with file_path.open("rb") as f:
261
+ file_content = f.read()
296
262
 
297
- if description:
298
- params["description"] = description
263
+ # Prepare multipart form data
264
+ files = {"file": (file_path.name, file_content, "text/plain")}
299
265
 
300
266
  response, _, _ = await self._requestor.arequest(
301
267
  options=SeekrFlowRequest(
302
268
  method="PATCH",
303
269
  url=f"functions/{function_id}",
304
270
  files=files,
305
- params=params,
306
271
  ),
307
272
  )
308
273
 
@@ -16,6 +16,7 @@ class ObservabilitySpansRequest(BaseModel):
16
16
  trace_id: Optional[str]
17
17
  thread_id: Optional[str]
18
18
  group: Optional[str]
19
+ metadata: Optional[dict[str, str]]
19
20
  limit: int = 100
20
21
  order: str = "desc"
21
22
  offset: int = 0
@@ -59,6 +59,7 @@ class RunRequest(BaseModel):
59
59
  model_settings: ModelSettings = ModelSettings()
60
60
  response_format: Optional[Union[ResponseFormat, Dict[str, Any], type]] = None
61
61
  group: Optional[str] = None
62
+ metadata: Optional[Dict[str, str]] = None
62
63
 
63
64
 
64
65
  class RunResponse(BaseModel):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: seekrai
3
- Version: 0.5.15
3
+ Version: 0.5.16
4
4
  Summary: Python client for SeekrAI
5
5
  License: Apache-2.0
6
6
  Author: SeekrFlow
@@ -8,10 +8,10 @@ seekrai/error.py,sha256=rAYL8qEd8INwYMMKvhS-HKeC3QkWL4Wq-zfazFU-zBg,4861
8
8
  seekrai/filemanager.py,sha256=bO2OvjZ9Cx5r2vr3Ocpd_0qVc3owRDT2LCU4Zmp2uDY,15489
9
9
  seekrai/resources/__init__.py,sha256=x39Gx6-ErQHNxhDB0CplXURk3kx-4OGpxm3r6HJr7Ds,1628
10
10
  seekrai/resources/agents/__init__.py,sha256=8zQIr2LEJyuaVwbU6WmItGu0F8VWTa7eYrquyHUY1QY,700
11
- seekrai/resources/agents/agent_inference.py,sha256=si8BzMV2p6_TCTIT7jd4j9ae4p4HwFlxCWUpo-J1d_g,10146
12
- seekrai/resources/agents/agent_observability.py,sha256=CnHK948NwHYpr_FBDzvmq8xxU6NFx0FowM6CbN32o1k,4089
11
+ seekrai/resources/agents/agent_inference.py,sha256=KIxdEV9qMA7tscrVGp4-Fe1H_iBqdY7Oh7rkpPDNfjo,10568
12
+ seekrai/resources/agents/agent_observability.py,sha256=VC_iyJnTwZ6PdQPp0T9XzipXOruh8P7h_UCwLjbY1Sk,4253
13
13
  seekrai/resources/agents/agents.py,sha256=frmLHvrqeUxnMkE9Xn4w1ugChM14S9ik4MwWyklPMWI,9607
14
- seekrai/resources/agents/python_functions.py,sha256=2GSiWhKTto8ixE5OG6WsN-GWEwyf1wpdhG3_EziACsg,10367
14
+ seekrai/resources/agents/python_functions.py,sha256=VL1JSsPP5nN1m8I0Ihe3AYlb8TMRg2n9-FWsWeNZH2s,9277
15
15
  seekrai/resources/agents/threads.py,sha256=BwZ2_6wlezsb12PQjEw1fgdJh5S83SPgD6qZQoGvyIM,14544
16
16
  seekrai/resources/alignment.py,sha256=IOKlKK2I9_NhS9pwcrsd9-5OO7lVT8Uw0y_wuGHOnyA,5839
17
17
  seekrai/resources/chat/__init__.py,sha256=KmtPupgECtEN80NyvcnSmieTAFXhwmVxhMHP0qhspA4,618
@@ -33,9 +33,9 @@ seekrai/types/__init__.py,sha256=N72VsnmOdvLxnhBFLgfugIkT0tqr-M7WVFpAFtXEjLI,466
33
33
  seekrai/types/abstract.py,sha256=TqWFQV_6bPblywfCH-r8FCkXWvPkc9KlJ4QVgyrnaMc,642
34
34
  seekrai/types/agents/__init__.py,sha256=STRQlgnapxFT5egAP_i3yZSh9gauGmJBHTzdvH8tbdk,2395
35
35
  seekrai/types/agents/agent.py,sha256=85D4GeHF-bYYnPirJSi1MbFg_2uFE2fSEmAHV9LxZfQ,1132
36
- seekrai/types/agents/observability.py,sha256=E4FSHJEoA7t2rirZQw9UE267Z8vNtKgs4niOc0RVOqg,924
36
+ seekrai/types/agents/observability.py,sha256=kOpBrNsrOzSbf-AsRBWAxRB9FqO0063CshUr-r2hHBE,963
37
37
  seekrai/types/agents/python_functions.py,sha256=31Jm46gryHsgNsC7nlivuyY0TSko58y2YVxsu_7bEAg,653
38
- seekrai/types/agents/runs.py,sha256=qjlPet4mr-ZPXF_jumDPNa7Pe-uwMCSUJSG0jQ1ZLxc,4887
38
+ seekrai/types/agents/runs.py,sha256=JgvasNM_eesGbwnqeAbRzPNvbzLAG1_N2IU7M7OHD1w,4933
39
39
  seekrai/types/agents/threads.py,sha256=TinCMKv1bi5LzboDyCx1XI4Zzd8UzUZos4VOrTNhmEc,6835
40
40
  seekrai/types/agents/tools/__init__.py,sha256=4MmlL13JLhWgMUlL3TKfegiA-IXGG06YellZTSTVFC8,537
41
41
  seekrai/types/agents/tools/env_model_config.py,sha256=9POx2DPwfSXgoaziJv7QvKeMrhMsYD1exnanSRK48vw,177
@@ -69,8 +69,8 @@ seekrai/utils/api_helpers.py,sha256=0Y8BblNIr9h_R12zdmhkxgTlxgoRkbq84QNi4nNWGu8,
69
69
  seekrai/utils/files.py,sha256=7ixn_hgV-6pEhYqLyOp-EN0o8c1CzUwJzX9n3PQ5oqo,7164
70
70
  seekrai/utils/tools.py,sha256=jgJTL-dOIouDbEJLdQpQfpXhqaz_poQYS52adyUtBjo,1781
71
71
  seekrai/version.py,sha256=q6iGQVFor8zXiPP5F-3vy9TndOxKv5JXbaNJ2kdOQws,125
72
- seekrai-0.5.15.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
73
- seekrai-0.5.15.dist-info/METADATA,sha256=q2xaCaeQH1Nywj_P_aoQrxfwz2AjgLk3zPmjCGciWow,4781
74
- seekrai-0.5.15.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
75
- seekrai-0.5.15.dist-info/entry_points.txt,sha256=N49yOEGi1sK7Xr13F_rkkcOxQ88suyiMoOmRhUHTZ_U,48
76
- seekrai-0.5.15.dist-info/RECORD,,
72
+ seekrai-0.5.16.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
73
+ seekrai-0.5.16.dist-info/METADATA,sha256=Qwkh2LCsf_1wzdjQ8k6RRk4Iu0qqowufPTlnIVvc-KY,4781
74
+ seekrai-0.5.16.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
75
+ seekrai-0.5.16.dist-info/entry_points.txt,sha256=N49yOEGi1sK7Xr13F_rkkcOxQ88suyiMoOmRhUHTZ_U,48
76
+ seekrai-0.5.16.dist-info/RECORD,,