Skip to content

Commit 1ce36eb

Browse files
committed
## Python SDK Changes:
* `glean.agents.get_run()`: **Added** * `glean.chat.create()`: * `request.text` **Added** * `response.output[].content[].structured_output` **Added** * `glean.client.search.retrieve_feed()`: * `request.categories[].enum(create_agent)` **Added** * `response.results[]` **Changed**
1 parent 5bf88df commit 1ce36eb

71 files changed

Lines changed: 2774 additions & 150 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: 219 additions & 73 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: 256 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ openapi: 3.1.0
22
info:
33
version: "0.9.0"
44
title: Glean API
5-
x-source-commit-sha: 5f1d873383438dc574c1075f9476915610e56875
6-
x-open-api-commit-sha: 6a8c8e16bbbca13a130766a72f307fb373b8256a
5+
x-source-commit-sha: 0567955c577b9e280c36bf6b66198b361268a1be
6+
x-open-api-commit-sha: 5d4ca2ef3216bc5fad7c31ab45c6bcc85502dac1
77
description: |
88
# Introduction
99
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.
@@ -214,7 +214,6 @@ paths:
214214
id: 1
215215
event: message
216216
data: {"messages":[{"role":"GLEAN_AI","content":[{"text":"Hello","type":"text"}]}]}
217-
218217
id: 2
219218
event: message
220219
data: {"messages":[{"role":"GLEAN_AI","content":[{"text":", I can help with HR policy questions.","type":"text"}]}]}
@@ -252,6 +251,61 @@ paths:
252251
x-speakeasy-name-override: createRun
253252
security:
254253
- APIToken: []
254+
/api/agents/{agent_id}/runs/{run_id}:
255+
get:
256+
tags:
257+
- Agents
258+
summary: Get agent run
259+
description: |
260+
Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the specified agent, and the user must still have access to that agent. Unknown runs, runs owned by another user, and mismatched agent/run identifiers return 404. Requires the agents.run scope. Executions without a persisted workflow record are not available through this endpoint.
261+
operationId: platform-agents-get-run
262+
x-visibility: Public
263+
parameters:
264+
- in: path
265+
name: agent_id
266+
description: ID of the agent that owns the run.
267+
required: true
268+
example: "{agent_id}"
269+
schema:
270+
type: string
271+
minLength: 1
272+
maxLength: 256
273+
- in: path
274+
name: run_id
275+
description: ID of the durable run to retrieve.
276+
required: true
277+
example: "{run_id}"
278+
schema:
279+
type: string
280+
minLength: 1
281+
maxLength: 256
282+
responses:
283+
"200":
284+
description: Current persisted run snapshot. A failed execution is still a successful retrieval.
285+
content:
286+
application/json:
287+
schema:
288+
$ref: "#/components/schemas/PlatformAgentRunResponse"
289+
"400":
290+
$ref: "#/components/responses/PlatformBadRequest"
291+
"401":
292+
$ref: "#/components/responses/PlatformUnauthorized"
293+
"403":
294+
$ref: "#/components/responses/PlatformForbidden"
295+
"404":
296+
$ref: "#/components/responses/PlatformNotFound"
297+
"408":
298+
$ref: "#/components/responses/PlatformRequestTimeout"
299+
"429":
300+
$ref: "#/components/responses/PlatformTooManyRequests"
301+
"500":
302+
$ref: "#/components/responses/PlatformInternalServerError"
303+
"503":
304+
$ref: "#/components/responses/PlatformServiceUnavailable"
305+
x-speakeasy-group: agents
306+
x-speakeasy-name-override: getRun
307+
security:
308+
- APIToken: []
255309
/api/chat:
256310
post:
257311
tags:
@@ -7429,6 +7483,124 @@ components:
74297483
description: One entry per tool the caller must authorize.
74307484
items:
74317485
$ref: "#/components/schemas/PlatformAuthenticationSuggestion"
7486+
PlatformAgentRunState:
7487+
type: string
7488+
enum:
7489+
- QUEUED
7490+
- RUNNING
7491+
- REQUIRES_INPUT
7492+
- SUCCEEDED
7493+
- FAILED
7494+
- CANCELLING
7495+
- CANCELLED
7496+
- EXPIRED
7497+
description: State of the persisted workflow execution. REQUIRES_INPUT is nonterminal.
7498+
PlatformAgentRunToolApproval:
7499+
type: object
7500+
description: Pending approval for a specific persisted tool invocation and its arguments.
7501+
required:
7502+
- interaction_id
7503+
- type
7504+
- display_name
7505+
- description
7506+
- arguments
7507+
properties:
7508+
interaction_id:
7509+
type: string
7510+
description: Identifies this specific invocation approval, not the tool definition.
7511+
type:
7512+
type: string
7513+
enum:
7514+
- TOOL_APPROVAL
7515+
description: Interaction type identifying a tool execution approval request.
7516+
tool_id:
7517+
type: string
7518+
description: Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools.
7519+
display_name:
7520+
type: string
7521+
description: Display name of the tool requesting approval.
7522+
description:
7523+
type: string
7524+
description: Description of the tool associated with this approval request.
7525+
arguments:
7526+
type: object
7527+
additionalProperties: true
7528+
description: Arguments from the persisted approval request. Older platform tools use flattened parameters.
7529+
expires_at:
7530+
type: string
7531+
format: date-time
7532+
description: Approval deadline, when one is set. Omitted when the approval has no expiration.
7533+
PlatformAgentRunError:
7534+
type: object
7535+
description: Caller-safe details of an agent run execution failure.
7536+
required:
7537+
- code
7538+
- message
7539+
properties:
7540+
code:
7541+
type: string
7542+
description: Machine-readable execution failure code.
7543+
message:
7544+
type: string
7545+
description: Caller-safe execution failure description.
7546+
PlatformDurableAgentRun:
7547+
type: object
7548+
description: Agent run state, pending tool approvals, and output available independently of the creation request.
7549+
required:
7550+
- run_id
7551+
- agent_id
7552+
- state
7553+
- created_at
7554+
- updated_at
7555+
- pending_interactions
7556+
properties:
7557+
run_id:
7558+
type: string
7559+
description: ID of the run, preserved across approval continuations.
7560+
agent_id:
7561+
type: string
7562+
description: ID of the agent that owns the run.
7563+
state:
7564+
$ref: "#/components/schemas/PlatformAgentRunState"
7565+
description: Current lifecycle state of the run.
7566+
created_at:
7567+
type: string
7568+
format: date-time
7569+
description: Timestamp when the run was first persisted.
7570+
updated_at:
7571+
type: string
7572+
format: date-time
7573+
description: |
7574+
Latest persisted activity timestamp across the execution and its messages, including checkpoint messages. This is not a worker heartbeat or an exact state-transition timestamp.
7575+
expires_at:
7576+
type: string
7577+
format: date-time
7578+
description: Execution deadline, when one is set. Not the run history retention deadline.
7579+
pending_interactions:
7580+
type: array
7581+
description: Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states.
7582+
items:
7583+
$ref: "#/components/schemas/PlatformAgentRunToolApproval"
7584+
output:
7585+
type: object
7586+
additionalProperties: true
7587+
description: Accumulated text-only agent output under the messages key, when available.
7588+
error:
7589+
$ref: "#/components/schemas/PlatformAgentRunError"
7590+
description: Caller-safe failure details when the run is in FAILED.
7591+
PlatformAgentRunResponse:
7592+
type: object
7593+
description: Persisted agent run snapshot with a request ID for support correlation.
7594+
required:
7595+
- run
7596+
- request_id
7597+
properties:
7598+
run:
7599+
$ref: "#/components/schemas/PlatformDurableAgentRun"
7600+
description: Current persisted snapshot of the requested agent run.
7601+
request_id:
7602+
type: string
7603+
description: Platform-generated request ID for support correlation.
74327604
PlatformChatInputMessage:
74337605
type: object
74347606
additionalProperties: false
@@ -7444,13 +7616,72 @@ components:
74447616
content:
74457617
type: string
74467618
minLength: 1
7619+
PlatformChatTextFormat:
7620+
type: object
7621+
additionalProperties: false
7622+
description: Unconstrained plain-text assistant output.
7623+
required:
7624+
- type
7625+
properties:
7626+
type:
7627+
type: string
7628+
description: Discriminator. Must be TEXT.
7629+
enum:
7630+
- TEXT
7631+
PlatformChatJsonSchemaFormat:
7632+
type: object
7633+
additionalProperties: false
7634+
description: Constrains the assistant response to a caller-supplied JSON Schema.
7635+
required:
7636+
- type
7637+
- name
7638+
- schema
7639+
properties:
7640+
type:
7641+
type: string
7642+
description: Discriminator. Must be JSON_SCHEMA.
7643+
enum:
7644+
- JSON_SCHEMA
7645+
name:
7646+
type: string
7647+
minLength: 1
7648+
maxLength: 64
7649+
description: A stable identifier for the schema.
7650+
description:
7651+
type: string
7652+
maxLength: 1024
7653+
description: An optional human-readable description of the schema.
7654+
schema:
7655+
type: object
7656+
additionalProperties: true
7657+
description: A JSON Schema object describing the desired output shape.
7658+
strict:
7659+
type: boolean
7660+
default: true
7661+
description: |
7662+
When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true.
74477663
PlatformChatCreateRequest:
74487664
type: object
74497665
additionalProperties: false
74507666
required:
74517667
- input
74527668
example:
7453-
input: What is our parental leave policy?
7669+
input: Summarize our parental leave policy as JSON.
7670+
text:
7671+
format:
7672+
type: JSON_SCHEMA
7673+
name: policy_summary
7674+
schema:
7675+
type: object
7676+
properties:
7677+
eligible_employees:
7678+
type: string
7679+
duration_weeks:
7680+
type: integer
7681+
required:
7682+
- eligible_employees
7683+
- duration_weeks
7684+
strict: true
74547685
properties:
74557686
input:
74567687
description: |
@@ -7477,6 +7708,18 @@ components:
74777708
minLength: 1
74787709
description: |
74797710
Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
7711+
text:
7712+
type: object
7713+
additionalProperties: false
7714+
description: |
7715+
Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.
7716+
properties:
7717+
format:
7718+
description: |
7719+
Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema.
7720+
oneOf:
7721+
- $ref: "#/components/schemas/PlatformChatTextFormat"
7722+
- $ref: "#/components/schemas/PlatformChatJsonSchemaFormat"
74807723
PlatformChatStreamResponseId:
74817724
type: string
74827725
minLength: 1
@@ -7496,6 +7739,12 @@ components:
74967739
- OUTPUT_TEXT
74977740
text:
74987741
type: string
7742+
structured_output:
7743+
type:
7744+
- object
7745+
- "null"
7746+
description: |
7747+
Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`.
74997748
annotations:
75007749
type: array
75017750
items:
@@ -16128,6 +16377,7 @@ components:
1612816377
- EDIT_DOC
1612916378
- CHAT_TO_ARTIFACT
1613016379
- SHARE_ARTIFACT
16380+
- CREATE_AGENT
1613116381
description: Categories of content requested. An allowlist gives flexibility to request content separately or together.
1613216382
requestOptions:
1613316383
$ref: '#/components/schemas/FeedRequestOptions'
@@ -16603,6 +16853,7 @@ components:
1660316853
- EDIT_DOC
1660416854
- CHAT_TO_ARTIFACT
1660516855
- SHARE_ARTIFACT
16856+
- CREATE_AGENT
1660616857
description: Type of the justification.
1660716858
justification:
1660816859
type: string
@@ -16701,6 +16952,7 @@ components:
1670116952
- EDIT_DOC
1670216953
- CHAT_TO_ARTIFACT
1670316954
- SHARE_ARTIFACT
16955+
- CREATE_AGENT
1670416956
description: Category of the result, one of the requested categories in incoming request.
1670516957
primaryEntry:
1670616958
$ref: '#/components/schemas/FeedEntry'

‎.speakeasy/tests.arazzo.yaml‎

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159049,9 +159049,24 @@ workflows:
159049159049
requestBody:
159050159050
contentType: application/json
159051159051
payload:
159052-
input: What is our parental leave policy?
159052+
input: Summarize our parental leave policy as JSON.
159053159053
store: true
159054159054
stream: false
159055+
text:
159056+
format:
159057+
name: policy_summary
159058+
schema:
159059+
properties:
159060+
duration_weeks:
159061+
type: integer
159062+
eligible_employees:
159063+
type: string
159064+
required:
159065+
- eligible_employees
159066+
- duration_weeks
159067+
type: object
159068+
strict: true
159069+
type: JSON_SCHEMA
159055159070
successCriteria:
159056159071
- condition: $statusCode == 200
159057159072
- condition: $response.header.Content-Type == application/json
@@ -159458,3 +159473,23 @@ workflows:
159458159473
type: simple
159459159474
x-speakeasy-test-group: triggers
159460159475
x-speakeasy-test-rebuild: true
159476+
- workflowId: platform-agents-get-run
159477+
steps:
159478+
- stepId: test
159479+
operationId: platform-agents-get-run
159480+
parameters:
159481+
- name: agent_id
159482+
in: path
159483+
value: '{agent_id}'
159484+
- name: run_id
159485+
in: path
159486+
value: '{run_id}'
159487+
successCriteria:
159488+
- condition: $statusCode == 200
159489+
- condition: $response.header.Content-Type == application/json
159490+
- context: $response.body
159491+
condition: |
159492+
{"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>"}
159493+
type: simple
159494+
x-speakeasy-test-group: agents
159495+
x-speakeasy-test-rebuild: true

0 commit comments

Comments
 (0)