Skip to content

Commit 43df781

Browse files
committed
## Python SDK Changes:
* `glean.client.chat.create()`: `response.status[202]` **Added** (Breaking ⚠️) * `glean.agents.create_agent()`: **Added**
1 parent 8411597 commit 43df781

24 files changed

Lines changed: 926 additions & 202 deletions

.speakeasy/gen.lock

Lines changed: 69 additions & 30 deletions
Large diffs are not rendered by default.

.speakeasy/gen.yaml

Lines changed: 4 additions & 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.13.0
37+
version: 0.13.1
3838
additionalDependencies:
3939
dev: {}
4040
main: {}
@@ -54,6 +54,9 @@ python:
5454
enableCustomCodeRegions: false
5555
enumFormat: enum
5656
envVarPrefix: GLEAN
57+
eventStreamClassNames:
58+
async: EventStreamAsync
59+
sync: EventStream
5760
fixFlags:
5861
asyncPaginationSep2025: false
5962
conflictResistantModelImportsFeb2026: false

.speakeasy/glean-merged-spec.yaml

Lines changed: 127 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ openapi: 3.0.0
22
info:
33
version: 0.9.0
44
title: Glean API
5-
x-source-commit-sha: deacbe1e0fd0b5074c1b1445f05b4a5df529f487
5+
x-source-commit-sha: b9ccec7d05a7bdb183fded5c10a67ae457d71853
66
description: |
77
# Introduction
88
In addition to the data sources that Glean has built-in support for, Glean also provides a REST API that enables customers to put arbitrary content in the search index. This is useful, for example, for doing permissions-aware search over content in internal tools that reside on-prem as well as for searching over applications that Glean does not currently support first class. In addition these APIs allow the customer to push organization data (people info, organization structure etc) into Glean.
@@ -22,7 +22,7 @@ info:
2222
These API clients provide type-safe, idiomatic interfaces for working with Glean IndexingAPIs in your language of choice.
2323
x-logo:
2424
url: https://app.glean.com/images/glean-text2.svg
25-
x-open-api-commit-sha: 7de1c5956c93a8bdd7b4a2c6a4c6fd98b0c4df70
25+
x-open-api-commit-sha: 04d057a1ee884ee7cd054bc62ae2048c76d90b02
2626
x-speakeasy-name: 'Glean API'
2727
servers:
2828
- url: https://{instance}-be.glean.com
@@ -569,6 +569,23 @@ paths:
569569
startIndex: 0
570570
endIndex: 12
571571
type: CITATION
572+
"202":
573+
description: |
574+
Request accepted but not yet processed. Returned when another
575+
in-flight request is already running for the same chat session;
576+
the body's `queuedRequestId` identifies the deferred run and
577+
output will be persisted to the chat session referenced by
578+
`chatId`.
579+
content:
580+
application/json:
581+
schema:
582+
$ref: "#/components/schemas/ChatResponse"
583+
examples:
584+
queuedExample:
585+
value:
586+
chatId: abc123
587+
queuedRequestId: qr-xyz
588+
isSavedToChatHistory: true
572589
"400":
573590
description: Invalid request
574591
"401":
@@ -893,6 +910,40 @@ paths:
893910
description: Internal server error.
894911
security:
895912
- APIToken: []
913+
/rest/api/v1/agents:
914+
post:
915+
tags:
916+
- Agents
917+
summary: Create an agent
918+
description: Create an agent.
919+
operationId: createAgent
920+
x-visibility: Preview
921+
parameters:
922+
- $ref: "#/components/parameters/locale"
923+
- $ref: "#/components/parameters/timezoneOffset"
924+
requestBody:
925+
required: true
926+
content:
927+
application/json:
928+
schema:
929+
$ref: "#/components/schemas/CreateWorkflowRequest"
930+
responses:
931+
"200":
932+
description: Success
933+
content:
934+
application/json:
935+
schema:
936+
$ref: "#/components/schemas/CreateWorkflowResponse"
937+
"400":
938+
description: Bad request
939+
"401":
940+
description: Not Authorized
941+
"403":
942+
description: Forbidden
943+
"500":
944+
description: Internal server error
945+
security:
946+
- APIToken: []
896947
/rest/api/v1/agents/{agent_id}:
897948
get:
898949
tags:
@@ -8973,6 +9024,80 @@ components:
89739024
items:
89749025
type: string
89759026
description: IDs of files to delete.
9027+
WorkflowDraftableProperties:
9028+
properties:
9029+
name:
9030+
type: string
9031+
description: The name of the workflow.
9032+
WorkflowMutableProperties:
9033+
type: object
9034+
allOf:
9035+
- $ref: "#/components/schemas/WorkflowDraftableProperties"
9036+
- type: object
9037+
CreateWorkflowRequest:
9038+
allOf:
9039+
- $ref: "#/components/schemas/WorkflowMutableProperties"
9040+
- type: object
9041+
properties:
9042+
transient:
9043+
type: boolean
9044+
description: Used to create a transient workflow.
9045+
parentWorkflowId:
9046+
type: string
9047+
description: id of the parent workflow for transient workflows
9048+
WorkflowMetadata:
9049+
allOf:
9050+
- type: object
9051+
properties:
9052+
author:
9053+
$ref: "#/components/schemas/Person"
9054+
createTimestamp:
9055+
type: integer
9056+
description: Server Unix timestamp of the creation time.
9057+
lastUpdateTimestamp:
9058+
type: integer
9059+
description: Server Unix timestamp of the last update time.
9060+
lastDraftSavedAt:
9061+
type: integer
9062+
description: Server Unix timestamp of the last time the draft was saved.
9063+
lastDraftSavedBy:
9064+
description: The person who last saved the draft.
9065+
$ref: "#/components/schemas/Person"
9066+
lastDraftGitAuthorId:
9067+
type: string
9068+
description: ID of the VCS user (e.g. GitHub username) who last saved the draft. Set only by the draft save path via the external Git integration API.
9069+
lastUpdatedBy:
9070+
$ref: "#/components/schemas/Person"
9071+
AttributionProperties: {}
9072+
Workflow:
9073+
allOf:
9074+
- $ref: "#/components/schemas/PermissionedObject"
9075+
- $ref: "#/components/schemas/WorkflowMutableProperties"
9076+
- $ref: "#/components/schemas/WorkflowMetadata"
9077+
- $ref: "#/components/schemas/AttributionProperties"
9078+
- type: object
9079+
properties:
9080+
id:
9081+
type: string
9082+
description: The ID of the workflow.
9083+
verified:
9084+
type: boolean
9085+
readOnly: true
9086+
description: When present, indicates this workflow is admin-verified. Set via the dedicated admin settings endpoint, not by regular edits.
9087+
showOrganizationAsAuthor:
9088+
type: boolean
9089+
readOnly: true
9090+
description: When true, displays organization name instead of author name in agent card. Set via the dedicated admin settings endpoint, not by regular edits.
9091+
WorkflowResult:
9092+
type: object
9093+
required:
9094+
- workflow
9095+
properties:
9096+
workflow:
9097+
$ref: "#/components/schemas/Workflow"
9098+
CreateWorkflowResponse:
9099+
allOf:
9100+
- $ref: "#/components/schemas/WorkflowResult"
89769101
Agent:
89779102
title: Agent
89789103
type: object
@@ -9025,16 +9150,6 @@ components:
90259150
message:
90269151
type: string
90279152
description: Client-facing error message describing what went wrong
9028-
WorkflowDraftableProperties:
9029-
properties:
9030-
name:
9031-
type: string
9032-
description: The name of the workflow.
9033-
WorkflowMutableProperties:
9034-
type: object
9035-
allOf:
9036-
- $ref: "#/components/schemas/WorkflowDraftableProperties"
9037-
- type: object
90389153
EditWorkflowRequest:
90399154
allOf:
90409155
- $ref: "#/components/schemas/WorkflowMutableProperties"
@@ -11293,7 +11408,6 @@ components:
1129311408
description: A list of removed user roles for the Workflow.
1129411409
items:
1129511410
$ref: "#/components/schemas/UserRoleSpecification"
11296-
AttributionProperties: {}
1129711411
PromptTemplate:
1129811412
allOf:
1129911413
- $ref: "#/components/schemas/PromptTemplateMutableProperties"
@@ -11369,55 +11483,6 @@ components:
1136911483
runCount:
1137011484
$ref: "#/components/schemas/CountInfo"
1137111485
description: This tracks how many times this prompt template was run. If user runs a prompt template after modifying the original one, it still counts as a run for the original template.
11372-
WorkflowMetadata:
11373-
allOf:
11374-
- type: object
11375-
properties:
11376-
author:
11377-
$ref: "#/components/schemas/Person"
11378-
createTimestamp:
11379-
type: integer
11380-
description: Server Unix timestamp of the creation time.
11381-
lastUpdateTimestamp:
11382-
type: integer
11383-
description: Server Unix timestamp of the last update time.
11384-
lastDraftSavedAt:
11385-
type: integer
11386-
description: Server Unix timestamp of the last time the draft was saved.
11387-
lastDraftSavedBy:
11388-
description: The person who last saved the draft.
11389-
$ref: "#/components/schemas/Person"
11390-
lastDraftGitAuthorId:
11391-
type: string
11392-
description: ID of the VCS user (e.g. GitHub username) who last saved the draft. Set only by the draft save path via the external Git integration API.
11393-
lastUpdatedBy:
11394-
$ref: "#/components/schemas/Person"
11395-
Workflow:
11396-
allOf:
11397-
- $ref: "#/components/schemas/PermissionedObject"
11398-
- $ref: "#/components/schemas/WorkflowMutableProperties"
11399-
- $ref: "#/components/schemas/WorkflowMetadata"
11400-
- $ref: "#/components/schemas/AttributionProperties"
11401-
- type: object
11402-
properties:
11403-
id:
11404-
type: string
11405-
description: The ID of the workflow.
11406-
verified:
11407-
type: boolean
11408-
readOnly: true
11409-
description: When present, indicates this workflow is admin-verified. Set via the dedicated admin settings endpoint, not by regular edits.
11410-
showOrganizationAsAuthor:
11411-
type: boolean
11412-
readOnly: true
11413-
description: When true, displays organization name instead of author name in agent card. Set via the dedicated admin settings endpoint, not by regular edits.
11414-
WorkflowResult:
11415-
type: object
11416-
required:
11417-
- workflow
11418-
properties:
11419-
workflow:
11420-
$ref: "#/components/schemas/Workflow"
1142111486
UserActivity:
1142211487
properties:
1142311488
actor:

.speakeasy/tests.arazzo.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158705,3 +158705,19 @@ workflows:
158705158705
type: simple
158706158706
x-speakeasy-test-group: Datasources
158707158707
x-speakeasy-test-rebuild: true
158708+
- workflowId: createAgent
158709+
steps:
158710+
- stepId: test
158711+
operationId: createAgent
158712+
requestBody:
158713+
contentType: application/json
158714+
payload: {}
158715+
successCriteria:
158716+
- condition: $statusCode == 200
158717+
- condition: $response.header.Content-Type == application/json
158718+
- context: $response.body
158719+
condition: |
158720+
{"workflow":{"author":{"name":"George Clooney","obfuscatedId":"abc123"},"lastDraftSavedBy":{"name":"George Clooney","obfuscatedId":"abc123"},"lastUpdatedBy":{"name":"George Clooney","obfuscatedId":"abc123"}}}
158721+
type: simple
158722+
x-speakeasy-test-group: Agents
158723+
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.770.0
1+
speakeasyVersion: 1.773.1
22
sources:
33
Glean API:
44
sourceNamespace: glean-api-specs
5-
sourceRevisionDigest: sha256:500649ecd919cc2dcfeb6c54fe552ddcf8628a42b2f67a2ef0f206ad8561a56c
6-
sourceBlobDigest: sha256:cb8902f4548ad637f07f6be9b7ef3f0d5fda8fe6f6540c7eea338bf4dde98413
5+
sourceRevisionDigest: sha256:b7175ea063b56dd93b27f307044f5d68103ceca629274570a0933bd9af493f2e
6+
sourceBlobDigest: sha256:cfa7e1503a2c59e44a2d44bf69a2db12324cb1a152d29942c68a969962ea5c09
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:500649ecd919cc2dcfeb6c54fe552ddcf8628a42b2f67a2ef0f206ad8561a56c
20-
sourceBlobDigest: sha256:cb8902f4548ad637f07f6be9b7ef3f0d5fda8fe6f6540c7eea338bf4dde98413
19+
sourceRevisionDigest: sha256:b7175ea063b56dd93b27f307044f5d68103ceca629274570a0933bd9af493f2e
20+
sourceBlobDigest: sha256:cfa7e1503a2c59e44a2d44bf69a2db12324cb1a152d29942c68a969962ea5c09
2121
codeSamplesNamespace: glean-api-specs-python-code-samples
22-
codeSamplesRevisionDigest: sha256:cc23275cb351da5ef6256061aed3868dab2d09e7764658ea22e4958928b42d8c
22+
codeSamplesRevisionDigest: sha256:60aa38a0f093349fa189ac4f535bcdf0b2bc99464ffb48ebf83b4318400ff5de
2323
workflow:
2424
workflowVersion: 1.0.0
2525
speakeasyVersion: latest

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ For more information on obtaining the appropriate token type, please contact you
339339

340340
### [Agents](docs/sdks/agents/README.md)
341341

342+
* [create_agent](docs/sdks/agents/README.md#create_agent) - Create an agent
342343
* [edit_agent](docs/sdks/agents/README.md#edit_agent) - Edit an agent
343344

344345
### [Authentication](docs/sdks/authentication/README.md)

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,4 +748,14 @@ Based on:
748748
### Generated
749749
- [python v0.13.0] .
750750
### Releases
751-
- [PyPI v0.13.0] https://pypi.org/project/glean-api-client/0.13.0 - .
751+
- [PyPI v0.13.0] https://pypi.org/project/glean-api-client/0.13.0 - .
752+
753+
## 2026-06-09 03:42:45
754+
### Changes
755+
Based on:
756+
- OpenAPI Doc
757+
- Speakeasy CLI 1.773.1 (2.897.1) https://github.com/speakeasy-api/speakeasy
758+
### Generated
759+
- [python v0.13.1] .
760+
### Releases
761+
- [PyPI v0.13.1] https://pypi.org/project/glean-api-client/0.13.1 - .

docs/models/createagentrequest.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# CreateAgentRequest
2+
3+
4+
## Fields
5+
6+
| Field | Type | Required | Description |
7+
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
8+
| `locale` | *Optional[str]* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. |
9+
| `timezone_offset` | *Optional[int]* | :heavy_minus_sign: | The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. |
10+
| `create_workflow_request` | [models.CreateWorkflowRequest](../models/createworkflowrequest.md) | :heavy_check_mark: | N/A |
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# CreateWorkflowRequest
2+
3+
4+
## Fields
5+
6+
| Field | Type | Required | Description |
7+
| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- |
8+
| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the workflow. |
9+
| `transient` | *Optional[bool]* | :heavy_minus_sign: | Used to create a transient workflow. |
10+
| `parent_workflow_id` | *Optional[str]* | :heavy_minus_sign: | id of the parent workflow for transient workflows |

0 commit comments

Comments
 (0)