Skip to content

Commit 82a6f5e

Browse files
committed
## Python SDK Changes:
* `glean.agents.create_run()`: * `request.execution_mode` **Added** * `response.status[201]` **Added** (Breaking ⚠️) * `glean.agents.get_run()`: **Added** * `glean.agents.cancel_run()`: **Added** * `glean.chat.create()`: * `request.text` **Added** * `response.output[].content[].structured_output` **Added** * `glean.client.search.retrieve_feed()`: * `request.categories[]` **Changed** * `response.results[]` **Changed**
1 parent 5bf88df commit 82a6f5e

93 files changed

Lines changed: 3731 additions & 287 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.speakeasy/gen.lock‎

Lines changed: 297 additions & 102 deletions
Large diffs are not rendered by default.

‎.speakeasy/gen.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ generation:
3434
generateNewTests: true
3535
skipResponseBodyAssertions: true
3636
python:
37-
version: 0.17.14
37+
version: 0.17.15
3838
additionalDependencies:
3939
dev: {}
4040
main: {}

‎.speakeasy/glean-merged-spec.yaml‎

Lines changed: 377 additions & 36 deletions
Large diffs are not rendered by default.

‎.speakeasy/tests.arazzo.yaml‎

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158786,6 +158786,7 @@ workflows:
158786158786
requestBody:
158787158787
contentType: application/json
158788158788
payload:
158789+
execution_mode: REQUEST_BOUND
158789158790
messages:
158790158791
- content:
158791158792
- text: What is our parental leave policy?
@@ -159049,9 +159050,24 @@ workflows:
159049159050
requestBody:
159050159051
contentType: application/json
159051159052
payload:
159052-
input: What is our parental leave policy?
159053+
input: Summarize our parental leave policy as JSON.
159053159054
store: true
159054159055
stream: false
159056+
text:
159057+
format:
159058+
name: policy_summary
159059+
schema:
159060+
properties:
159061+
duration_weeks:
159062+
type: integer
159063+
eligible_employees:
159064+
type: string
159065+
required:
159066+
- eligible_employees
159067+
- duration_weeks
159068+
type: object
159069+
strict: true
159070+
type: JSON_SCHEMA
159055159071
successCriteria:
159056159072
- condition: $statusCode == 200
159057159073
- condition: $response.header.Content-Type == application/json
@@ -159458,3 +159474,44 @@ workflows:
159458159474
type: simple
159459159475
x-speakeasy-test-group: triggers
159460159476
x-speakeasy-test-rebuild: true
159477+
- workflowId: platform-agents-get-run
159478+
steps:
159479+
- stepId: test
159480+
operationId: platform-agents-get-run
159481+
parameters:
159482+
- name: agent_id
159483+
in: path
159484+
value: '{agent_id}'
159485+
- name: run_id
159486+
in: path
159487+
value: '{run_id}'
159488+
successCriteria:
159489+
- condition: $statusCode == 200
159490+
- condition: $response.header.Content-Type == application/json
159491+
- context: $response.body
159492+
condition: |
159493+
{"run":{"run_id":"<id>","agent_id":"<id>","state":"CANCELLING","created_at":"2025-02-20T06:37:06.101Z","updated_at":"2025-06-13T07:24:18.599Z","pending_interactions":[]},"request_id":"<id>"}
159494+
type: simple
159495+
x-speakeasy-test-group: agents
159496+
x-speakeasy-test-rebuild: true
159497+
- workflowId: platform-agents-cancel-run
159498+
steps:
159499+
- stepId: test
159500+
operationId: platform-agents-cancel-run
159501+
parameters:
159502+
- name: agent_id
159503+
in: path
159504+
value: '{agent_id}'
159505+
requestBody:
159506+
contentType: application/json
159507+
payload:
159508+
run_id: '{run_id}'
159509+
successCriteria:
159510+
- condition: $statusCode == 200
159511+
- condition: $response.header.Content-Type == application/json
159512+
- context: $response.body
159513+
condition: |
159514+
{"run":{"run_id":"<id>","agent_id":"<id>","state":"REQUIRES_INPUT","created_at":"2026-04-14T14:14:08.916Z","updated_at":"2025-07-26T12:32:21.659Z","pending_interactions":[]},"request_id":"<id>"}
159515+
type: simple
159516+
x-speakeasy-test-group: agents
159517+
x-speakeasy-test-rebuild: true

‎.speakeasy/workflow.lock‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
speakeasyVersion: 1.797.0
1+
speakeasyVersion: 1.798.0
22
sources:
33
Glean API:
44
sourceNamespace: glean-api-specs
5-
sourceRevisionDigest: sha256:1f470e422d6b202bf6bb80cc2e4b73077b7dab6d476cda804245fc0402ea42f1
6-
sourceBlobDigest: sha256:8919e7ffe50c1ca78844cd89c216e8ab3c54a8e0003bd5072e7fe3cd35fb192c
5+
sourceRevisionDigest: sha256:51a2ae2ddc0506348a548b81bbfc517db29d486741b6fb3bdcfe6079486345a8
6+
sourceBlobDigest: sha256:0ca86697f3d5bf207a57eff48ba53bf61652bbd41a51c85dc703f4e42801bba1
77
tags:
88
- latest
99
Glean Client API:
@@ -16,10 +16,10 @@ targets:
1616
glean:
1717
source: Glean API
1818
sourceNamespace: glean-api-specs
19-
sourceRevisionDigest: sha256:1f470e422d6b202bf6bb80cc2e4b73077b7dab6d476cda804245fc0402ea42f1
20-
sourceBlobDigest: sha256:8919e7ffe50c1ca78844cd89c216e8ab3c54a8e0003bd5072e7fe3cd35fb192c
19+
sourceRevisionDigest: sha256:51a2ae2ddc0506348a548b81bbfc517db29d486741b6fb3bdcfe6079486345a8
20+
sourceBlobDigest: sha256:0ca86697f3d5bf207a57eff48ba53bf61652bbd41a51c85dc703f4e42801bba1
2121
codeSamplesNamespace: glean-api-specs-python-code-samples
22-
codeSamplesRevisionDigest: sha256:07e63ad12522c0ccf6dc9dab0943696972a489679ebc077bb6bfd23d25a123b8
22+
codeSamplesRevisionDigest: sha256:4b2e09c30603fa7bafedcd030f47d04e433326986d431bc3add72686a1146188
2323
workflow:
2424
workflowVersion: 1.0.0
2525
speakeasyVersion: latest

‎README.md‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ For more information on obtaining the appropriate token type, please contact you
321321
* [get](docs/sdks/agents/README.md#get) - Get agent
322322
* [get_schemas](docs/sdks/agents/README.md#get_schemas) - Get agent schemas
323323
* [create_run](docs/sdks/agents/README.md#create_run) - Create agent run
324+
* [get_run](docs/sdks/agents/README.md#get_run) - Get agent run
325+
* [cancel_run](docs/sdks/agents/README.md#cancel_run) - Cancel an agent run
324326

325327
### [Chat](docs/sdks/chatsdk/README.md)
326328

@@ -605,15 +607,36 @@ The stream is also a [Context Manager][context-manager] and can be used with the
605607
underlying connection when the context is exited.
606608

607609
```python
608-
from glean.api_client import Glean
610+
from glean.api_client import Glean, models
609611
import os
610612

611613

612614
with Glean(
613615
api_token=os.getenv("GLEAN_API_TOKEN", ""),
614616
) as glean:
615617

616-
res = glean.chat.create_stream(input="What is our parental leave policy?", store=True)
618+
res = glean.chat.create_stream(input="Summarize our parental leave policy as JSON.", store=True, text={
619+
"format_": {
620+
"type": models.PlatformChatJSONSchemaFormatType.JSON_SCHEMA,
621+
"name": "policy_summary",
622+
"schema_": {
623+
"type": "object",
624+
"properties": {
625+
"eligible_employees": {
626+
"type": "string",
627+
},
628+
"duration_weeks": {
629+
"type": "integer",
630+
},
631+
},
632+
"required": [
633+
"eligible_employees",
634+
"duration_weeks",
635+
],
636+
},
637+
"strict": True,
638+
},
639+
})
617640

618641
with res as event_stream:
619642
for event in event_stream:

‎RELEASES.md‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,4 +998,14 @@ Based on:
998998
### Generated
999999
- [python v0.17.14] .
10001000
### Releases
1001-
- [PyPI v0.17.14] https://pypi.org/project/glean-api-client/0.17.14 - .
1001+
- [PyPI v0.17.14] https://pypi.org/project/glean-api-client/0.17.14 - .
1002+
1003+
## 2026-09-22 21:18:58
1004+
### Changes
1005+
Based on:
1006+
- OpenAPI Doc
1007+
- Speakeasy CLI 1.798.0 (2.938.0) https://github.com/speakeasy-api/speakeasy
1008+
### Generated
1009+
- [python v0.17.15] .
1010+
### Releases
1011+
- [PyPI v0.17.15] https://pypi.org/project/glean-api-client/0.17.15 - .

‎docs/models/executionmode.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# ExecutionMode
2+
3+
REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped.
4+
5+
6+
## Example Usage
7+
8+
```python
9+
from glean.api_client.models import ExecutionMode
10+
11+
value = ExecutionMode.REQUEST_BOUND
12+
```
13+
14+
15+
## Values
16+
17+
| Name | Value |
18+
| --------------- | --------------- |
19+
| `REQUEST_BOUND` | REQUEST_BOUND |
20+
| `DURABLE` | DURABLE |

‎docs/models/feedrequestcategory.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,6 @@ value = FeedRequestCategory.DOCUMENT_SUGGESTION
6464
| `ARTIFACT_CREATION` | ARTIFACT_CREATION |
6565
| `EDIT_DOC` | EDIT_DOC |
6666
| `CHAT_TO_ARTIFACT` | CHAT_TO_ARTIFACT |
67-
| `SHARE_ARTIFACT` | SHARE_ARTIFACT |
67+
| `SHARE_ARTIFACT` | SHARE_ARTIFACT |
68+
| `CREATE_AGENT` | CREATE_AGENT |
69+
| `MANAGER_INVITE` | MANAGER_INVITE |

‎docs/models/feedresultcategory.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,6 @@ value = FeedResultCategory.DOCUMENT_SUGGESTION
6868
| `ARTIFACT_CREATION` | ARTIFACT_CREATION |
6969
| `EDIT_DOC` | EDIT_DOC |
7070
| `CHAT_TO_ARTIFACT` | CHAT_TO_ARTIFACT |
71-
| `SHARE_ARTIFACT` | SHARE_ARTIFACT |
71+
| `SHARE_ARTIFACT` | SHARE_ARTIFACT |
72+
| `CREATE_AGENT` | CREATE_AGENT |
73+
| `MANAGER_INVITE` | MANAGER_INVITE |

0 commit comments

Comments
 (0)