Skip to content

Commit 64105f0

Browse files
Merge pull request #4 from gleanwork/speakeasy-sdk-regen-1746034554
chore: 🐝 Update SDK - Generate 0.1.0-beta.1
2 parents 56f07b5 + 00661be commit 64105f0

File tree

13 files changed

+1075
-117
lines changed

13 files changed

+1075
-117
lines changed

.devcontainer/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11

2+
<div align="center">
3+
<a href="https://codespaces.new/gleanwork/api-client-python.git/tree/main"><img src="https://github.com/codespaces/badge.svg" /></a>
4+
</div>
5+
<br>
6+
27
> **Remember to shutdown a GitHub Codespace when it is not in use!**
38
49
# Dev Containers Quick Start

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.speakeasy/logs/
12
README-PYPI.md
23
.speakeasy/temp/
34
.venv/

.speakeasy/gen.lock

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
lockVersion: 2.0.0
22
id: 3e3290ca-0ee8-4981-b1bc-14536048fa63
33
management:
4-
docChecksum: 1a2c49930fef57ea7cddf2ed9b486f1d
4+
docChecksum: 5f39e048571bfcd8aae3cc610c7d8852
55
docVersion: 0.9.0
6-
speakeasyVersion: 1.540.1
7-
generationVersion: 2.593.4
8-
releaseVersion: 0.1.0-beta
9-
configChecksum: 2eb6e69e776fc13633d54cf3cb06eb96
10-
installationURL: https://github.com/gleanwork/api-client-python
6+
speakeasyVersion: 1.541.0
7+
generationVersion: 2.595.2
8+
releaseVersion: 0.1.0-beta.1
9+
configChecksum: d580b6391c961eb65ccf46848050e4e1
10+
repoURL: https://github.com/gleanwork/api-client-python.git
11+
installationURL: https://github.com/gleanwork/api-client-python.git
1112
published: true
1213
features:
1314
python:
@@ -20,6 +21,7 @@ features:
2021
devContainers: 3.0.0
2122
enumUnions: 0.1.0
2223
envVarSecurityUsage: 0.3.2
24+
examples: 3.0.1
2325
flatRequests: 1.0.1
2426
flattening: 3.1.1
2527
globalSecurity: 3.0.3

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ generation:
2424
generateNewTests: true
2525
skipResponseBodyAssertions: true
2626
python:
27-
version: 0.1.0-beta
27+
version: 0.1.0-beta.1
2828
additionalDependencies:
2929
dev: {}
3030
main: {}

.speakeasy/glean-merged-spec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ paths:
522522
description: Too Many Requests
523523
x-speakeasy-group: client.chat
524524
x-speakeasy-name-override: start
525+
x-speakeasy-usage-example: true
525526
/rest/api/v1/deleteallchats:
526527
post:
527528
tags:

.speakeasy/workflow.lock

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
speakeasyVersion: 1.540.1
1+
speakeasyVersion: 1.541.0
22
sources:
33
Glean API:
44
sourceNamespace: glean-api-specs
5-
sourceRevisionDigest: sha256:459a0d8f65fc33f9bd3dea1af13989875150f772a13bb05c25a36b1bb662da8b
6-
sourceBlobDigest: sha256:02dae61341a702b82c050ed3828f22d5a82de8e9f2fa6a99ddab6ad0dfe4a38a
5+
sourceRevisionDigest: sha256:1756c09ecbe23405704c2ca0a7fc16f744e0104dd7eae3eea4f70d5a04348c16
6+
sourceBlobDigest: sha256:774205fd75a3374e402da1109732bc48f7fcd38efe41d5709663e17ac4f28898
77
tags:
88
- latest
9+
- speakeasy-sdk-regen-1746034554
910
Glean Client API:
1011
sourceNamespace: glean-client-api
1112
sourceRevisionDigest: sha256:4edc63ad559e4f2c9fb9ebf5edaaaaa9269f1874d271cfd84b441d6dacac43d2
@@ -16,8 +17,10 @@ targets:
1617
glean:
1718
source: Glean API
1819
sourceNamespace: glean-api-specs
19-
sourceRevisionDigest: sha256:459a0d8f65fc33f9bd3dea1af13989875150f772a13bb05c25a36b1bb662da8b
20-
sourceBlobDigest: sha256:02dae61341a702b82c050ed3828f22d5a82de8e9f2fa6a99ddab6ad0dfe4a38a
20+
sourceRevisionDigest: sha256:1756c09ecbe23405704c2ca0a7fc16f744e0104dd7eae3eea4f70d5a04348c16
21+
sourceBlobDigest: sha256:774205fd75a3374e402da1109732bc48f7fcd38efe41d5709663e17ac4f28898
22+
codeSamplesNamespace: glean-api-specs-python-code-samples
23+
codeSamplesRevisionDigest: sha256:08d0c8eae645f27afac8c7c6391a113c9cd2a793c2342fecddea220a3a47df50
2124
workflow:
2225
workflowVersion: 1.0.0
2326
speakeasyVersion: latest
@@ -37,7 +40,7 @@ workflow:
3740
registry:
3841
location: registry.speakeasyapi.dev/glean-el2/sdk/glean-api-specs-python-code-samples
3942
labelOverride:
40-
fixedValue: Python (SDK)
43+
fixedValue: Python (Client)
4144
blocking: false
4245
testing:
4346
enabled: true

README.md

Lines changed: 18 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ The Glean Python SDK provides convenient access to the Glean REST API from any P
77
## Table of Contents
88
<!-- $toc-max-depth=2 -->
99
* [Glean Python API Client](#glean-python-api-client)
10-
* [Usage guidelines](#usage-guidelines)
1110
* [SDK Installation](#sdk-installation)
1211
* [IDE Support](#ide-support)
1312
* [SDK Example Usage](#sdk-example-usage)
@@ -100,40 +99,25 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
10099
```python
101100
# Synchronous Example
102101
from glean import Glean, models
103-
from glean.utils import parse_datetime
104102
import os
105103

106104

107105
with Glean(
108106
bearer_auth=os.getenv("GLEAN_BEARER_AUTH", ""),
109107
) as g_client:
110108

111-
g_client.client.activity.report(events=[
109+
res = g_client.client.chat.start(messages=[
112110
{
113-
"action": models.ActivityEventAction.HISTORICAL_VIEW,
114-
"timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
115-
"url": "https://example.com/",
111+
"fragments": [
112+
models.ChatMessageFragment(
113+
text="What are the company holidays this year?",
114+
),
115+
],
116116
},
117-
{
118-
"action": models.ActivityEventAction.SEARCH,
119-
"params": {
120-
"query": "query",
121-
},
122-
"timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
123-
"url": "https://example.com/search?q=query",
124-
},
125-
{
126-
"action": models.ActivityEventAction.VIEW,
127-
"params": {
128-
"duration": 20,
129-
"referrer": "https://example.com/document",
130-
},
131-
"timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
132-
"url": "https://example.com/",
133-
},
134-
])
117+
], timeout_millis=30000)
135118

136-
# Use the SDK ...
119+
# Handle response
120+
print(res)
137121
```
138122

139123
</br>
@@ -143,7 +127,6 @@ The same SDK client can also be used to make asychronous requests by importing a
143127
# Asynchronous Example
144128
import asyncio
145129
from glean import Glean, models
146-
from glean.utils import parse_datetime
147130
import os
148131

149132
async def main():
@@ -152,32 +135,18 @@ async def main():
152135
bearer_auth=os.getenv("GLEAN_BEARER_AUTH", ""),
153136
) as g_client:
154137

155-
await g_client.client.activity.report_async(events=[
138+
res = await g_client.client.chat.start_async(messages=[
156139
{
157-
"action": models.ActivityEventAction.HISTORICAL_VIEW,
158-
"timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
159-
"url": "https://example.com/",
160-
},
161-
{
162-
"action": models.ActivityEventAction.SEARCH,
163-
"params": {
164-
"query": "query",
165-
},
166-
"timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
167-
"url": "https://example.com/search?q=query",
168-
},
169-
{
170-
"action": models.ActivityEventAction.VIEW,
171-
"params": {
172-
"duration": 20,
173-
"referrer": "https://example.com/document",
174-
},
175-
"timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
176-
"url": "https://example.com/",
140+
"fragments": [
141+
models.ChatMessageFragment(
142+
text="What are the company holidays this year?",
143+
),
144+
],
177145
},
178-
])
146+
], timeout_millis=30000)
179147

180-
# Use the SDK ...
148+
# Handle response
149+
print(res)
181150

182151
asyncio.run(main())
183152
```

RELEASES.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
3+
## 2025-04-30 17:35:36
4+
### Changes
5+
Based on:
6+
- OpenAPI Doc
7+
- Speakeasy CLI 1.541.0 (2.595.2) https://github.com/speakeasy-api/speakeasy
8+
### Generated
9+
- [python v0.1.0-beta.1] .
10+
### Releases
11+
- [PyPI v0.1.0-beta.1] https://pypi.org/project/glean/0.1.0-beta.1 - .

USAGE.md

Lines changed: 18 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,25 @@
22
```python
33
# Synchronous Example
44
from glean import Glean, models
5-
from glean.utils import parse_datetime
65
import os
76

87

98
with Glean(
109
bearer_auth=os.getenv("GLEAN_BEARER_AUTH", ""),
1110
) as g_client:
1211

13-
g_client.client.activity.report(events=[
12+
res = g_client.client.chat.start(messages=[
1413
{
15-
"action": models.ActivityEventAction.HISTORICAL_VIEW,
16-
"timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
17-
"url": "https://example.com/",
14+
"fragments": [
15+
models.ChatMessageFragment(
16+
text="What are the company holidays this year?",
17+
),
18+
],
1819
},
19-
{
20-
"action": models.ActivityEventAction.SEARCH,
21-
"params": {
22-
"query": "query",
23-
},
24-
"timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
25-
"url": "https://example.com/search?q=query",
26-
},
27-
{
28-
"action": models.ActivityEventAction.VIEW,
29-
"params": {
30-
"duration": 20,
31-
"referrer": "https://example.com/document",
32-
},
33-
"timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
34-
"url": "https://example.com/",
35-
},
36-
])
20+
], timeout_millis=30000)
3721

38-
# Use the SDK ...
22+
# Handle response
23+
print(res)
3924
```
4025

4126
</br>
@@ -45,7 +30,6 @@ The same SDK client can also be used to make asychronous requests by importing a
4530
# Asynchronous Example
4631
import asyncio
4732
from glean import Glean, models
48-
from glean.utils import parse_datetime
4933
import os
5034

5135
async def main():
@@ -54,32 +38,18 @@ async def main():
5438
bearer_auth=os.getenv("GLEAN_BEARER_AUTH", ""),
5539
) as g_client:
5640

57-
await g_client.client.activity.report_async(events=[
58-
{
59-
"action": models.ActivityEventAction.HISTORICAL_VIEW,
60-
"timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
61-
"url": "https://example.com/",
62-
},
63-
{
64-
"action": models.ActivityEventAction.SEARCH,
65-
"params": {
66-
"query": "query",
67-
},
68-
"timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
69-
"url": "https://example.com/search?q=query",
70-
},
41+
res = await g_client.client.chat.start_async(messages=[
7142
{
72-
"action": models.ActivityEventAction.VIEW,
73-
"params": {
74-
"duration": 20,
75-
"referrer": "https://example.com/document",
76-
},
77-
"timestamp": parse_datetime("2000-01-23T04:56:07.000Z"),
78-
"url": "https://example.com/",
43+
"fragments": [
44+
models.ChatMessageFragment(
45+
text="What are the company holidays this year?",
46+
),
47+
],
7948
},
80-
])
49+
], timeout_millis=30000)
8150

82-
# Use the SDK ...
51+
# Handle response
52+
print(res)
8353

8454
asyncio.run(main())
8555
```

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "api-client-glean"
3-
version = "0.1.0-beta"
3+
version = "0.1.0-beta.1"
44
description = "Python Client SDK Generated by Speakeasy."
55
authors = [{ name = "Speakeasy" },]
66
readme = "README-PYPI.md"

0 commit comments

Comments
 (0)