Skip to content

Commit 114198b

Browse files
feat(api): Adding prompts API to stainless config
Adding prompts API to stainless config
1 parent d861708 commit 114198b

19 files changed

+1713
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 104
1+
configured_endpoints: 111
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-35c6569e5e9fcc85084c9728eb7fc7c5908297fcc77043d621d25de3c850a990.yml
33
openapi_spec_hash: 0f95bbeee16f3205d36ec34cfa62c711
4-
config_hash: fa14a2107881931b2ddef8c768eeb558
4+
config_hash: ef275cc002a89629459fd73d0cf9cba9

api.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,29 @@ Methods:
102102

103103
- <code title="get /v1/responses/{response_id}/input_items">client.responses.input_items.<a href="./src/llama_stack_client/resources/responses/input_items.py">list</a>(response_id, \*\*<a href="src/llama_stack_client/types/responses/input_item_list_params.py">params</a>) -> <a href="./src/llama_stack_client/types/responses/input_item_list_response.py">InputItemListResponse</a></code>
104104

105+
# Prompts
106+
107+
Types:
108+
109+
```python
110+
from llama_stack_client.types import ListPromptsResponse, Prompt, PromptListResponse
111+
```
112+
113+
Methods:
114+
115+
- <code title="post /v1/prompts">client.prompts.<a href="./src/llama_stack_client/resources/prompts/prompts.py">create</a>(\*\*<a href="src/llama_stack_client/types/prompt_create_params.py">params</a>) -> <a href="./src/llama_stack_client/types/prompt.py">Prompt</a></code>
116+
- <code title="get /v1/prompts/{prompt_id}">client.prompts.<a href="./src/llama_stack_client/resources/prompts/prompts.py">retrieve</a>(prompt_id, \*\*<a href="src/llama_stack_client/types/prompt_retrieve_params.py">params</a>) -> <a href="./src/llama_stack_client/types/prompt.py">Prompt</a></code>
117+
- <code title="post /v1/prompts/{prompt_id}">client.prompts.<a href="./src/llama_stack_client/resources/prompts/prompts.py">update</a>(prompt_id, \*\*<a href="src/llama_stack_client/types/prompt_update_params.py">params</a>) -> <a href="./src/llama_stack_client/types/prompt.py">Prompt</a></code>
118+
- <code title="get /v1/prompts">client.prompts.<a href="./src/llama_stack_client/resources/prompts/prompts.py">list</a>() -> <a href="./src/llama_stack_client/types/prompt_list_response.py">PromptListResponse</a></code>
119+
- <code title="delete /v1/prompts/{prompt_id}">client.prompts.<a href="./src/llama_stack_client/resources/prompts/prompts.py">delete</a>(prompt_id) -> None</code>
120+
- <code title="post /v1/prompts/{prompt_id}/set-default-version">client.prompts.<a href="./src/llama_stack_client/resources/prompts/prompts.py">set_default_version</a>(prompt_id, \*\*<a href="src/llama_stack_client/types/prompt_set_default_version_params.py">params</a>) -> <a href="./src/llama_stack_client/types/prompt.py">Prompt</a></code>
121+
122+
## Versions
123+
124+
Methods:
125+
126+
- <code title="get /v1/prompts/{prompt_id}/versions">client.prompts.versions.<a href="./src/llama_stack_client/resources/prompts/versions.py">list</a>(prompt_id) -> <a href="./src/llama_stack_client/types/prompt_list_response.py">PromptListResponse</a></code>
127+
105128
# Conversations
106129

107130
Types:

src/llama_stack_client/_client.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
routes,
4949
safety,
5050
inspect,
51+
prompts,
5152
scoring,
5253
shields,
5354
providers,
@@ -80,6 +81,7 @@
8081
from .resources.completions import CompletionsResource, AsyncCompletionsResource
8182
from .resources.moderations import ModerationsResource, AsyncModerationsResource
8283
from .resources.models.models import ModelsResource, AsyncModelsResource
84+
from .resources.prompts.prompts import PromptsResource, AsyncPromptsResource
8385
from .resources.scoring_functions import ScoringFunctionsResource, AsyncScoringFunctionsResource
8486
from .resources.responses.responses import ResponsesResource, AsyncResponsesResource
8587
from .resources.synthetic_data_generation import (
@@ -183,6 +185,12 @@ def responses(self) -> ResponsesResource:
183185

184186
return ResponsesResource(self)
185187

188+
@cached_property
189+
def prompts(self) -> PromptsResource:
190+
from .resources.prompts import PromptsResource
191+
192+
return PromptsResource(self)
193+
186194
@cached_property
187195
def conversations(self) -> ConversationsResource:
188196
from .resources.conversations import ConversationsResource
@@ -493,6 +501,12 @@ def responses(self) -> AsyncResponsesResource:
493501

494502
return AsyncResponsesResource(self)
495503

504+
@cached_property
505+
def prompts(self) -> AsyncPromptsResource:
506+
from .resources.prompts import AsyncPromptsResource
507+
508+
return AsyncPromptsResource(self)
509+
496510
@cached_property
497511
def conversations(self) -> AsyncConversationsResource:
498512
from .resources.conversations import AsyncConversationsResource
@@ -752,6 +766,12 @@ def responses(self) -> responses.ResponsesResourceWithRawResponse:
752766

753767
return ResponsesResourceWithRawResponse(self._client.responses)
754768

769+
@cached_property
770+
def prompts(self) -> prompts.PromptsResourceWithRawResponse:
771+
from .resources.prompts import PromptsResourceWithRawResponse
772+
773+
return PromptsResourceWithRawResponse(self._client.prompts)
774+
755775
@cached_property
756776
def conversations(self) -> conversations.ConversationsResourceWithRawResponse:
757777
from .resources.conversations import ConversationsResourceWithRawResponse
@@ -897,6 +917,12 @@ def responses(self) -> responses.AsyncResponsesResourceWithRawResponse:
897917

898918
return AsyncResponsesResourceWithRawResponse(self._client.responses)
899919

920+
@cached_property
921+
def prompts(self) -> prompts.AsyncPromptsResourceWithRawResponse:
922+
from .resources.prompts import AsyncPromptsResourceWithRawResponse
923+
924+
return AsyncPromptsResourceWithRawResponse(self._client.prompts)
925+
900926
@cached_property
901927
def conversations(self) -> conversations.AsyncConversationsResourceWithRawResponse:
902928
from .resources.conversations import AsyncConversationsResourceWithRawResponse
@@ -1044,6 +1070,12 @@ def responses(self) -> responses.ResponsesResourceWithStreamingResponse:
10441070

10451071
return ResponsesResourceWithStreamingResponse(self._client.responses)
10461072

1073+
@cached_property
1074+
def prompts(self) -> prompts.PromptsResourceWithStreamingResponse:
1075+
from .resources.prompts import PromptsResourceWithStreamingResponse
1076+
1077+
return PromptsResourceWithStreamingResponse(self._client.prompts)
1078+
10471079
@cached_property
10481080
def conversations(self) -> conversations.ConversationsResourceWithStreamingResponse:
10491081
from .resources.conversations import ConversationsResourceWithStreamingResponse
@@ -1191,6 +1223,12 @@ def responses(self) -> responses.AsyncResponsesResourceWithStreamingResponse:
11911223

11921224
return AsyncResponsesResourceWithStreamingResponse(self._client.responses)
11931225

1226+
@cached_property
1227+
def prompts(self) -> prompts.AsyncPromptsResourceWithStreamingResponse:
1228+
from .resources.prompts import AsyncPromptsResourceWithStreamingResponse
1229+
1230+
return AsyncPromptsResourceWithStreamingResponse(self._client.prompts)
1231+
11941232
@cached_property
11951233
def conversations(self) -> conversations.AsyncConversationsResourceWithStreamingResponse:
11961234
from .resources.conversations import AsyncConversationsResourceWithStreamingResponse

src/llama_stack_client/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@
7878
InspectResourceWithStreamingResponse,
7979
AsyncInspectResourceWithStreamingResponse,
8080
)
81+
from .prompts import (
82+
PromptsResource,
83+
AsyncPromptsResource,
84+
PromptsResourceWithRawResponse,
85+
AsyncPromptsResourceWithRawResponse,
86+
PromptsResourceWithStreamingResponse,
87+
AsyncPromptsResourceWithStreamingResponse,
88+
)
8189
from .scoring import (
8290
ScoringResource,
8391
AsyncScoringResource,
@@ -216,6 +224,12 @@
216224
"AsyncResponsesResourceWithRawResponse",
217225
"ResponsesResourceWithStreamingResponse",
218226
"AsyncResponsesResourceWithStreamingResponse",
227+
"PromptsResource",
228+
"AsyncPromptsResource",
229+
"PromptsResourceWithRawResponse",
230+
"AsyncPromptsResourceWithRawResponse",
231+
"PromptsResourceWithStreamingResponse",
232+
"AsyncPromptsResourceWithStreamingResponse",
219233
"ConversationsResource",
220234
"AsyncConversationsResource",
221235
"ConversationsResourceWithRawResponse",
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .prompts import (
4+
PromptsResource,
5+
AsyncPromptsResource,
6+
PromptsResourceWithRawResponse,
7+
AsyncPromptsResourceWithRawResponse,
8+
PromptsResourceWithStreamingResponse,
9+
AsyncPromptsResourceWithStreamingResponse,
10+
)
11+
from .versions import (
12+
VersionsResource,
13+
AsyncVersionsResource,
14+
VersionsResourceWithRawResponse,
15+
AsyncVersionsResourceWithRawResponse,
16+
VersionsResourceWithStreamingResponse,
17+
AsyncVersionsResourceWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"VersionsResource",
22+
"AsyncVersionsResource",
23+
"VersionsResourceWithRawResponse",
24+
"AsyncVersionsResourceWithRawResponse",
25+
"VersionsResourceWithStreamingResponse",
26+
"AsyncVersionsResourceWithStreamingResponse",
27+
"PromptsResource",
28+
"AsyncPromptsResource",
29+
"PromptsResourceWithRawResponse",
30+
"AsyncPromptsResourceWithRawResponse",
31+
"PromptsResourceWithStreamingResponse",
32+
"AsyncPromptsResourceWithStreamingResponse",
33+
]

0 commit comments

Comments
 (0)