Skip to content

Commit 4fcdb0d

Browse files
author
Eric Huang (AI Platform)
committed
Sync updates from stainless branch: ehhuang/dev
1 parent b664564 commit 4fcdb0d

21 files changed

+106
-101
lines changed

src/llama_stack_client/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient
3838
from ._utils._logs import setup_logging as _setup_logging
3939

40+
from .lib.agents.agent import Agent
41+
from .lib.agents.event_logger import EventLogger as AgentEventLogger
42+
from .lib.inference.event_logger import EventLogger as InferenceEventLogger
43+
from .types.agents.turn_create_params import Document
44+
from .types.shared_params.document import Document as RAGDocument
45+
4046
__all__ = [
4147
"types",
4248
"__version__",

src/llama_stack_client/resources/benchmarks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, List, Type, Union, Iterable, Optional, cast
5+
from typing import Dict, List, Type, Union, Iterable, cast
66

77
import httpx
88

@@ -58,7 +58,7 @@ def retrieve(
5858
extra_query: Query | None = None,
5959
extra_body: Body | None = None,
6060
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
61-
) -> Optional[Benchmark]:
61+
) -> Benchmark:
6262
"""
6363
Args:
6464
extra_headers: Send extra headers
@@ -178,7 +178,7 @@ async def retrieve(
178178
extra_query: Query | None = None,
179179
extra_body: Body | None = None,
180180
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
181-
) -> Optional[Benchmark]:
181+
) -> Benchmark:
182182
"""
183183
Args:
184184
extra_headers: Send extra headers

src/llama_stack_client/resources/datasets.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Type, Union, Iterable, Optional, cast
5+
from typing import Dict, Type, Union, Iterable, cast
66
from typing_extensions import Literal
77

88
import httpx
@@ -61,7 +61,7 @@ def retrieve(
6161
extra_query: Query | None = None,
6262
extra_body: Body | None = None,
6363
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
64-
) -> Optional[DatasetRetrieveResponse]:
64+
) -> DatasetRetrieveResponse:
6565
"""
6666
Args:
6767
extra_headers: Send extra headers
@@ -122,7 +122,7 @@ def iterrows(
122122
Uses cursor-based pagination.
123123
124124
Args:
125-
limit: The number of rows to get per page.
125+
limit: The number of rows to get.
126126
127127
start_index: Index into dataset for the first row to get. Get all rows if None.
128128
@@ -185,8 +185,8 @@ def register(
185185
"Hello, John Doe. How can I help you today?"}, {"role": "user", "content":
186186
"What's my name?"}, ], "answer": "John Doe" }
187187
188-
source:
189-
The data source of the dataset. Examples: - { "type": "uri", "uri":
188+
source: The data source of the dataset. Ensure that the data source schema is compatible
189+
with the purpose of the dataset. Examples: - { "type": "uri", "uri":
190190
"https://mywebsite.com/mydata.jsonl" } - { "type": "uri", "uri":
191191
"lsfs://mydata.jsonl" } - { "type": "uri", "uri":
192192
"data:csv;base64,{base64_content}" } - { "type": "uri", "uri":
@@ -286,7 +286,7 @@ async def retrieve(
286286
extra_query: Query | None = None,
287287
extra_body: Body | None = None,
288288
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
289-
) -> Optional[DatasetRetrieveResponse]:
289+
) -> DatasetRetrieveResponse:
290290
"""
291291
Args:
292292
extra_headers: Send extra headers
@@ -347,7 +347,7 @@ async def iterrows(
347347
Uses cursor-based pagination.
348348
349349
Args:
350-
limit: The number of rows to get per page.
350+
limit: The number of rows to get.
351351
352352
start_index: Index into dataset for the first row to get. Get all rows if None.
353353
@@ -410,8 +410,8 @@ async def register(
410410
"Hello, John Doe. How can I help you today?"}, {"role": "user", "content":
411411
"What's my name?"}, ], "answer": "John Doe" }
412412
413-
source:
414-
The data source of the dataset. Examples: - { "type": "uri", "uri":
413+
source: The data source of the dataset. Ensure that the data source schema is compatible
414+
with the purpose of the dataset. Examples: - { "type": "uri", "uri":
415415
"https://mywebsite.com/mydata.jsonl" } - { "type": "uri", "uri":
416416
"lsfs://mydata.jsonl" } - { "type": "uri", "uri":
417417
"data:csv;base64,{base64_content}" } - { "type": "uri", "uri":

src/llama_stack_client/resources/eval/jobs.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
6-
75
import httpx
86

97
from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
@@ -126,7 +124,7 @@ def status(
126124
extra_query: Query | None = None,
127125
extra_body: Body | None = None,
128126
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
129-
) -> Optional[JobStatusResponse]:
127+
) -> JobStatusResponse:
130128
"""
131129
Get the status of a job.
132130
@@ -256,7 +254,7 @@ async def status(
256254
extra_query: Query | None = None,
257255
extra_body: Body | None = None,
258256
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
259-
) -> Optional[JobStatusResponse]:
257+
) -> JobStatusResponse:
260258
"""
261259
Get the status of a job.
262260

src/llama_stack_client/resources/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Type, Union, Iterable, Optional, cast
5+
from typing import Dict, Type, Union, Iterable, cast
66
from typing_extensions import Literal
77

88
import httpx
@@ -59,7 +59,7 @@ def retrieve(
5959
extra_query: Query | None = None,
6060
extra_body: Body | None = None,
6161
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
62-
) -> Optional[Model]:
62+
) -> Model:
6363
"""
6464
Args:
6565
extra_headers: Send extra headers
@@ -208,7 +208,7 @@ async def retrieve(
208208
extra_query: Query | None = None,
209209
extra_body: Body | None = None,
210210
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
211-
) -> Optional[Model]:
211+
) -> Model:
212212
"""
213213
Args:
214214
extra_headers: Send extra headers

src/llama_stack_client/resources/post_training/job.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Type, Optional, cast
5+
from typing import List, Type, cast
66

77
import httpx
88

@@ -81,7 +81,7 @@ def artifacts(
8181
extra_query: Query | None = None,
8282
extra_body: Body | None = None,
8383
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
84-
) -> Optional[JobArtifactsResponse]:
84+
) -> JobArtifactsResponse:
8585
"""
8686
Args:
8787
extra_headers: Send extra headers
@@ -145,7 +145,7 @@ def status(
145145
extra_query: Query | None = None,
146146
extra_body: Body | None = None,
147147
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
148-
) -> Optional[JobStatusResponse]:
148+
) -> JobStatusResponse:
149149
"""
150150
Args:
151151
extra_headers: Send extra headers
@@ -221,7 +221,7 @@ async def artifacts(
221221
extra_query: Query | None = None,
222222
extra_body: Body | None = None,
223223
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
224-
) -> Optional[JobArtifactsResponse]:
224+
) -> JobArtifactsResponse:
225225
"""
226226
Args:
227227
extra_headers: Send extra headers
@@ -285,7 +285,7 @@ async def status(
285285
extra_query: Query | None = None,
286286
extra_body: Body | None = None,
287287
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
288-
) -> Optional[JobStatusResponse]:
288+
) -> JobStatusResponse:
289289
"""
290290
Args:
291291
extra_headers: Send extra headers

src/llama_stack_client/resources/scoring_functions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Type, Optional, cast
5+
from typing import Type, cast
66

77
import httpx
88

@@ -60,7 +60,7 @@ def retrieve(
6060
extra_query: Query | None = None,
6161
extra_body: Body | None = None,
6262
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
63-
) -> Optional[ScoringFn]:
63+
) -> ScoringFn:
6464
"""
6565
Args:
6666
extra_headers: Send extra headers
@@ -180,7 +180,7 @@ async def retrieve(
180180
extra_query: Query | None = None,
181181
extra_body: Body | None = None,
182182
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
183-
) -> Optional[ScoringFn]:
183+
) -> ScoringFn:
184184
"""
185185
Args:
186186
extra_headers: Send extra headers

src/llama_stack_client/resources/shields.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Type, Union, Iterable, Optional, cast
5+
from typing import Dict, Type, Union, Iterable, cast
66

77
import httpx
88

@@ -58,7 +58,7 @@ def retrieve(
5858
extra_query: Query | None = None,
5959
extra_body: Body | None = None,
6060
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
61-
) -> Optional[Shield]:
61+
) -> Shield:
6262
"""
6363
Args:
6464
extra_headers: Send extra headers
@@ -173,7 +173,7 @@ async def retrieve(
173173
extra_query: Query | None = None,
174174
extra_body: Body | None = None,
175175
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
176-
) -> Optional[Shield]:
176+
) -> Shield:
177177
"""
178178
Args:
179179
extra_headers: Send extra headers

src/llama_stack_client/resources/vector_dbs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Type, Optional, cast
5+
from typing import Type, cast
66

77
import httpx
88

@@ -59,7 +59,7 @@ def retrieve(
5959
extra_query: Query | None = None,
6060
extra_body: Body | None = None,
6161
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
62-
) -> Optional[VectorDBRetrieveResponse]:
62+
) -> VectorDBRetrieveResponse:
6363
"""
6464
Args:
6565
extra_headers: Send extra headers
@@ -208,7 +208,7 @@ async def retrieve(
208208
extra_query: Query | None = None,
209209
extra_body: Body | None = None,
210210
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
211-
) -> Optional[VectorDBRetrieveResponse]:
211+
) -> VectorDBRetrieveResponse:
212212
"""
213213
Args:
214214
extra_headers: Send extra headers

src/llama_stack_client/types/dataset_iterrows_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class DatasetIterrowsParams(TypedDict, total=False):
1111
limit: int
12-
"""The number of rows to get per page."""
12+
"""The number of rows to get."""
1313

1414
start_index: int
1515
"""Index into dataset for the first row to get. Get all rows if None."""

0 commit comments

Comments
 (0)