Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
399 changes: 297 additions & 102 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ generation:
generateNewTests: true
skipResponseBodyAssertions: true
python:
version: 0.17.14
version: 0.17.15
additionalDependencies:
dev: {}
main: {}
Expand Down
413 changes: 377 additions & 36 deletions .speakeasy/glean-merged-spec.yaml

Large diffs are not rendered by default.

59 changes: 58 additions & 1 deletion .speakeasy/tests.arazzo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158786,6 +158786,7 @@ workflows:
requestBody:
contentType: application/json
payload:
execution_mode: REQUEST_BOUND
messages:
- content:
- text: What is our parental leave policy?
Expand Down Expand Up @@ -159049,9 +159050,24 @@ workflows:
requestBody:
contentType: application/json
payload:
input: What is our parental leave policy?
input: Summarize our parental leave policy as JSON.
store: true
stream: false
text:
format:
name: policy_summary
schema:
properties:
duration_weeks:
type: integer
eligible_employees:
type: string
required:
- eligible_employees
- duration_weeks
type: object
strict: true
type: JSON_SCHEMA
successCriteria:
- condition: $statusCode == 200
- condition: $response.header.Content-Type == application/json
Expand Down Expand Up @@ -159458,3 +159474,44 @@ workflows:
type: simple
x-speakeasy-test-group: triggers
x-speakeasy-test-rebuild: true
- workflowId: platform-agents-get-run
steps:
- stepId: test
operationId: platform-agents-get-run
parameters:
- name: agent_id
in: path
value: '{agent_id}'
- name: run_id
in: path
value: '{run_id}'
successCriteria:
- condition: $statusCode == 200
- condition: $response.header.Content-Type == application/json
- context: $response.body
condition: |
{"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>"}
type: simple
x-speakeasy-test-group: agents
x-speakeasy-test-rebuild: true
- workflowId: platform-agents-cancel-run
steps:
- stepId: test
operationId: platform-agents-cancel-run
parameters:
- name: agent_id
in: path
value: '{agent_id}'
requestBody:
contentType: application/json
payload:
run_id: '{run_id}'
successCriteria:
- condition: $statusCode == 200
- condition: $response.header.Content-Type == application/json
- context: $response.body
condition: |
{"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>"}
type: simple
x-speakeasy-test-group: agents
x-speakeasy-test-rebuild: true
12 changes: 6 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
speakeasyVersion: 1.797.0
speakeasyVersion: 1.798.0
sources:
Glean API:
sourceNamespace: glean-api-specs
sourceRevisionDigest: sha256:1f470e422d6b202bf6bb80cc2e4b73077b7dab6d476cda804245fc0402ea42f1
sourceBlobDigest: sha256:8919e7ffe50c1ca78844cd89c216e8ab3c54a8e0003bd5072e7fe3cd35fb192c
sourceRevisionDigest: sha256:51a2ae2ddc0506348a548b81bbfc517db29d486741b6fb3bdcfe6079486345a8
sourceBlobDigest: sha256:0ca86697f3d5bf207a57eff48ba53bf61652bbd41a51c85dc703f4e42801bba1
tags:
- latest
Glean Client API:
Expand All @@ -16,10 +16,10 @@ targets:
glean:
source: Glean API
sourceNamespace: glean-api-specs
sourceRevisionDigest: sha256:1f470e422d6b202bf6bb80cc2e4b73077b7dab6d476cda804245fc0402ea42f1
sourceBlobDigest: sha256:8919e7ffe50c1ca78844cd89c216e8ab3c54a8e0003bd5072e7fe3cd35fb192c
sourceRevisionDigest: sha256:51a2ae2ddc0506348a548b81bbfc517db29d486741b6fb3bdcfe6079486345a8
sourceBlobDigest: sha256:0ca86697f3d5bf207a57eff48ba53bf61652bbd41a51c85dc703f4e42801bba1
codeSamplesNamespace: glean-api-specs-python-code-samples
codeSamplesRevisionDigest: sha256:07e63ad12522c0ccf6dc9dab0943696972a489679ebc077bb6bfd23d25a123b8
codeSamplesRevisionDigest: sha256:4b2e09c30603fa7bafedcd030f47d04e433326986d431bc3add72686a1146188
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ For more information on obtaining the appropriate token type, please contact you
* [get](docs/sdks/agents/README.md#get) - Get agent
* [get_schemas](docs/sdks/agents/README.md#get_schemas) - Get agent schemas
* [create_run](docs/sdks/agents/README.md#create_run) - Create agent run
* [get_run](docs/sdks/agents/README.md#get_run) - Get agent run
* [cancel_run](docs/sdks/agents/README.md#cancel_run) - Cancel an agent run

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

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

```python
from glean.api_client import Glean
from glean.api_client import Glean, models
import os


with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:

res = glean.chat.create_stream(input="What is our parental leave policy?", store=True)
res = glean.chat.create_stream(input="Summarize our parental leave policy as JSON.", store=True, text={
"format_": {
"type": models.PlatformChatJSONSchemaFormatType.JSON_SCHEMA,
"name": "policy_summary",
"schema_": {
"type": "object",
"properties": {
"eligible_employees": {
"type": "string",
},
"duration_weeks": {
"type": "integer",
},
},
"required": [
"eligible_employees",
"duration_weeks",
],
},
"strict": True,
},
})

with res as event_stream:
for event in event_stream:
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -998,4 +998,14 @@ Based on:
### Generated
- [python v0.17.14] .
### Releases
- [PyPI v0.17.14] https://pypi.org/project/glean-api-client/0.17.14 - .
- [PyPI v0.17.14] https://pypi.org/project/glean-api-client/0.17.14 - .

## 2026-09-22 21:18:58
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.798.0 (2.938.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.17.15] .
### Releases
- [PyPI v0.17.15] https://pypi.org/project/glean-api-client/0.17.15 - .
20 changes: 20 additions & 0 deletions docs/models/executionmode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# ExecutionMode

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.


## Example Usage

```python
from glean.api_client.models import ExecutionMode

value = ExecutionMode.REQUEST_BOUND
```


## Values

| Name | Value |
| --------------- | --------------- |
| `REQUEST_BOUND` | REQUEST_BOUND |
| `DURABLE` | DURABLE |
4 changes: 3 additions & 1 deletion docs/models/feedrequestcategory.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,6 @@ value = FeedRequestCategory.DOCUMENT_SUGGESTION
| `ARTIFACT_CREATION` | ARTIFACT_CREATION |
| `EDIT_DOC` | EDIT_DOC |
| `CHAT_TO_ARTIFACT` | CHAT_TO_ARTIFACT |
| `SHARE_ARTIFACT` | SHARE_ARTIFACT |
| `SHARE_ARTIFACT` | SHARE_ARTIFACT |
| `CREATE_AGENT` | CREATE_AGENT |
| `MANAGER_INVITE` | MANAGER_INVITE |
4 changes: 3 additions & 1 deletion docs/models/feedresultcategory.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,6 @@ value = FeedResultCategory.DOCUMENT_SUGGESTION
| `ARTIFACT_CREATION` | ARTIFACT_CREATION |
| `EDIT_DOC` | EDIT_DOC |
| `CHAT_TO_ARTIFACT` | CHAT_TO_ARTIFACT |
| `SHARE_ARTIFACT` | SHARE_ARTIFACT |
| `SHARE_ARTIFACT` | SHARE_ARTIFACT |
| `CREATE_AGENT` | CREATE_AGENT |
| `MANAGER_INVITE` | MANAGER_INVITE |
4 changes: 3 additions & 1 deletion docs/models/justificationtype.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,6 @@ value = JustificationType.FREQUENTLY_ACCESSED
| `ARTIFACT_CREATION` | ARTIFACT_CREATION |
| `EDIT_DOC` | EDIT_DOC |
| `CHAT_TO_ARTIFACT` | CHAT_TO_ARTIFACT |
| `SHARE_ARTIFACT` | SHARE_ARTIFACT |
| `SHARE_ARTIFACT` | SHARE_ARTIFACT |
| `CREATE_AGENT` | CREATE_AGENT |
| `MANAGER_INVITE` | MANAGER_INVITE |
10 changes: 10 additions & 0 deletions docs/models/platformagentruncancellationrequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# PlatformAgentRunCancellationRequest

Request cooperative cancellation of a run owned by the caller.


## Fields

| Field | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `run_id` | *str* | :heavy_check_mark: | ID of the run to cancel. Must belong to the agent identified in the path. |
Loading
Loading