Skip to content
Merged
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
462 changes: 358 additions & 104 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
514 changes: 478 additions & 36 deletions .speakeasy/glean-merged-spec.yaml

Large diffs are not rendered by default.

83 changes: 82 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,68 @@ 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
- workflowId: platform-agents-create-run-responses
steps:
- stepId: test
operationId: platform-agents-create-run-responses
parameters:
- name: agent_id
in: path
value: '{agent_id}'
requestBody:
contentType: application/json
payload:
responses:
- decision: APPROVE
interaction_id: '{interaction_id}'
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":"QUEUED","created_at":"2024-08-26T19:05:47.442Z","updated_at":"2026-08-22T09:50:35.176Z","pending_interactions":[{"interaction_id":"<id>","type":"TOOL_APPROVAL","display_name":"King.Trantow44","description":"provided collectivization whereas disapprove gah astride under stoop louse","arguments":{"key":"<value>","key1":"<value>"}}]},"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:09823f8003cfb3ebf08b6adfa434cefda4c97f7ee64ae18dc0066fe392647c97
sourceBlobDigest: sha256:fc4fcf9c37dfd0e8387153211f760a21a602ede64951d4e4c824e8e1b168b7b8
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:09823f8003cfb3ebf08b6adfa434cefda4c97f7ee64ae18dc0066fe392647c97
sourceBlobDigest: sha256:fc4fcf9c37dfd0e8387153211f760a21a602ede64951d4e4c824e8e1b168b7b8
codeSamplesNamespace: glean-api-specs-python-code-samples
codeSamplesRevisionDigest: sha256:07e63ad12522c0ccf6dc9dab0943696972a489679ebc077bb6bfd23d25a123b8
codeSamplesRevisionDigest: sha256:5da391e8e0a7821657f62afcee0636ca4423213b036163bea43637e45c1f3c7c
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ 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
* [respond_to_run](docs/sdks/agents/README.md#respond_to_run) - Respond to agent run approvals

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

Expand Down Expand Up @@ -605,15 +608,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-23 18:28:49
### 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 - .
19 changes: 19 additions & 0 deletions docs/models/decision.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Decision

The decision for this invocation only. Rejection follows normal workflow behavior.

## Example Usage

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

value = Decision.APPROVE
```


## Values

| Name | Value |
| --------- | --------- |
| `APPROVE` | APPROVE |
| `REJECT` | REJECT |
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 |
11 changes: 11 additions & 0 deletions docs/models/platformagentrunapprovaldecision.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# PlatformAgentRunApprovalDecision

Approve or reject the invocation identified by a pending interaction ID.


## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| `interaction_id` | *str* | :heavy_check_mark: | The interaction_id returned in the run's pending_interactions. |
| `decision` | [models.Decision](../models/decision.md) | :heavy_check_mark: | The decision for this invocation only. Rejection follows normal workflow behavior. |
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