Skip to content

Commit 48b1b37

Browse files
feat: update code samples to include completions endpoints (#32)
* update code samples to include completions endpoints * update code samples to include completions endpoints
1 parent e22be50 commit 48b1b37

2 files changed

Lines changed: 79 additions & 1 deletion

File tree

codeSamples.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,84 @@ actions:
2020
2121
# Handle response
2222
print(res)
23+
- target: $["paths"]["/v1/completions"]["post"]
24+
update:
25+
x-codeSamples:
26+
- lang: python
27+
label: completions_create
28+
source: |-
29+
from atoma_sdk import AtomaSDK
30+
import os
31+
32+
with AtomaSDK(
33+
bearer_auth=os.getenv("ATOMASDK_BEARER_AUTH", ""),
34+
) as atoma_sdk:
35+
36+
completion = atoma_sdk.completions.create(
37+
model="meta-llama/Llama-3.3-70B-Instruct",
38+
prompt="Hello, how are you?"
39+
)
40+
41+
print(completion.choices[0].text)
42+
- target: $["paths"]["/v1/completions#stream"]["post"]
43+
update:
44+
x-codeSamples:
45+
- lang: python
46+
label: completions_create_stream
47+
source: |-
48+
from atoma_sdk import AtomaSDK
49+
import os
50+
51+
with AtomaSDK(
52+
bearer_auth=os.getenv("ATOMASDK_BEARER_AUTH", ""),
53+
) as atoma_sdk:
54+
55+
completion = atoma_sdk.completions.create_stream(
56+
model="meta-llama/Llama-3.3-70B-Instruct",
57+
prompt="Hello, how are you?"
58+
)
59+
60+
for chunk in completion:
61+
print(chunk.data.choices[0].text)
62+
- target: $["paths"]["/v1/confidential/completions"]["post"]
63+
update:
64+
x-codeSamples:
65+
- lang: python
66+
label: chat_completions_create
67+
source: |-
68+
from atoma_sdk import AtomaSDK
69+
import os
70+
71+
with AtomaSDK(
72+
bearer_auth=os.getenv("ATOMASDK_BEARER_AUTH", ""),
73+
) as atoma_sdk:
74+
75+
completion = atoma_sdk.confidential_completions.create(
76+
model="meta-llama/Llama-3.3-70B-Instruct",
77+
prompt="Hello, how are you?"
78+
)
79+
80+
print(completion.choices[0].text)
81+
- target: $["paths"]["/v1/confidential/completions#stream"]["post"]
82+
update:
83+
x-codeSamples:
84+
- lang: python
85+
label: confidential_completions_create_stream
86+
source: |-
87+
from atoma_sdk import AtomaSDK
88+
import os
89+
90+
with AtomaSDK(
91+
bearer_auth=os.getenv("ATOMASDK_BEARER_AUTH", ""),
92+
) as atoma_sdk:
93+
94+
completion = atoma_sdk.confidential_completions.create_stream(
95+
model="meta-llama/Llama-3.3-70B-Instruct",
96+
prompt="Hello, how are you?"
97+
)
98+
99+
for chunk in completion:
100+
print(chunk.data.choices[0].text)
23101
- target: $["paths"]["/v1/chat/completions"]["post"]
24102
update:
25103
x-codeSamples:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "atoma-sdk"
3-
version = "0.1.1"
3+
version = "0.1.3"
44
description = "Python Client SDK Generated by Speakeasy."
55
authors = ["Speakeasy"]
66
readme = "README-PYPI.md"

0 commit comments

Comments
 (0)