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
292 changes: 219 additions & 73 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
263 changes: 259 additions & 4 deletions .speakeasy/glean-merged-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ openapi: 3.1.0
info:
version: "0.9.0"
title: Glean API
x-source-commit-sha: 5f1d873383438dc574c1075f9476915610e56875
x-open-api-commit-sha: 6a8c8e16bbbca13a130766a72f307fb373b8256a
x-source-commit-sha: 717c039c2fd74cbe81fc6a9c0b1e690e4e1f55af
x-open-api-commit-sha: 33b9c3f1c98d9d8365a25ef3a884dff3007cd759
description: |
# Introduction
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.
Expand Down Expand Up @@ -214,7 +214,6 @@ paths:
id: 1
event: message
data: {"messages":[{"role":"GLEAN_AI","content":[{"text":"Hello","type":"text"}]}]}

id: 2
event: message
data: {"messages":[{"role":"GLEAN_AI","content":[{"text":", I can help with HR policy questions.","type":"text"}]}]}
Expand Down Expand Up @@ -252,6 +251,61 @@ paths:
x-speakeasy-name-override: createRun
security:
- APIToken: []
/api/agents/{agent_id}/runs/{run_id}:
get:
tags:
- Agents
summary: Get agent run
description: |
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.
operationId: platform-agents-get-run
x-visibility: Public
parameters:
- in: path
name: agent_id
description: ID of the agent that owns the run.
required: true
example: "{agent_id}"
schema:
type: string
minLength: 1
maxLength: 256
- in: path
name: run_id
description: ID of the durable run to retrieve.
required: true
example: "{run_id}"
schema:
type: string
minLength: 1
maxLength: 256
responses:
"200":
description: Current persisted run snapshot. A failed execution is still a successful retrieval.
content:
application/json:
schema:
$ref: "#/components/schemas/PlatformAgentRunResponse"
"400":
$ref: "#/components/responses/PlatformBadRequest"
"401":
$ref: "#/components/responses/PlatformUnauthorized"
"403":
$ref: "#/components/responses/PlatformForbidden"
"404":
$ref: "#/components/responses/PlatformNotFound"
"408":
$ref: "#/components/responses/PlatformRequestTimeout"
"429":
$ref: "#/components/responses/PlatformTooManyRequests"
"500":
$ref: "#/components/responses/PlatformInternalServerError"
"503":
$ref: "#/components/responses/PlatformServiceUnavailable"
x-speakeasy-group: agents
x-speakeasy-name-override: getRun
security:
- APIToken: []
/api/chat:
post:
tags:
Expand Down Expand Up @@ -7429,6 +7483,124 @@ components:
description: One entry per tool the caller must authorize.
items:
$ref: "#/components/schemas/PlatformAuthenticationSuggestion"
PlatformAgentRunState:
type: string
enum:
- QUEUED
- RUNNING
- REQUIRES_INPUT
- SUCCEEDED
- FAILED
- CANCELLING
- CANCELLED
- EXPIRED
description: State of the persisted workflow execution. REQUIRES_INPUT is nonterminal.
PlatformAgentRunToolApproval:
type: object
description: Pending approval for a specific persisted tool invocation and its arguments.
required:
- interaction_id
- type
- display_name
- description
- arguments
properties:
interaction_id:
type: string
description: Identifies this specific invocation approval, not the tool definition.
type:
type: string
enum:
- TOOL_APPROVAL
description: Interaction type identifying a tool execution approval request.
tool_id:
type: string
description: Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools.
display_name:
type: string
description: Display name of the tool requesting approval.
description:
type: string
description: Description of the tool associated with this approval request.
arguments:
type: object
additionalProperties: true
description: Arguments from the persisted approval request. Older platform tools use flattened parameters.
expires_at:
type: string
format: date-time
description: Approval deadline, when one is set. Omitted when the approval has no expiration.
PlatformAgentRunError:
type: object
description: Caller-safe details of an agent run execution failure.
required:
- code
- message
properties:
code:
type: string
description: Machine-readable execution failure code.
message:
type: string
description: Caller-safe execution failure description.
PlatformDurableAgentRun:
type: object
description: Agent run state, pending tool approvals, and output available independently of the creation request.
required:
- run_id
- agent_id
- state
- created_at
- updated_at
- pending_interactions
properties:
run_id:
type: string
description: ID of the run, preserved across approval continuations.
agent_id:
type: string
description: ID of the agent that owns the run.
state:
$ref: "#/components/schemas/PlatformAgentRunState"
description: Current lifecycle state of the run.
created_at:
type: string
format: date-time
description: Timestamp when the run was first persisted.
updated_at:
type: string
format: date-time
description: |
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.
expires_at:
type: string
format: date-time
description: Execution deadline, when one is set. Not the run history retention deadline.
pending_interactions:
type: array
description: Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states.
items:
$ref: "#/components/schemas/PlatformAgentRunToolApproval"
output:
type: object
additionalProperties: true
description: Accumulated text-only agent output under the messages key, when available.
error:
$ref: "#/components/schemas/PlatformAgentRunError"
description: Caller-safe failure details when the run is in FAILED.
PlatformAgentRunResponse:
type: object
description: Persisted agent run snapshot with a request ID for support correlation.
required:
- run
- request_id
properties:
run:
$ref: "#/components/schemas/PlatformDurableAgentRun"
description: Current persisted snapshot of the requested agent run.
request_id:
type: string
description: Platform-generated request ID for support correlation.
PlatformChatInputMessage:
type: object
additionalProperties: false
Expand All @@ -7444,13 +7616,72 @@ components:
content:
type: string
minLength: 1
PlatformChatTextFormat:
type: object
additionalProperties: false
description: Unconstrained plain-text assistant output.
required:
- type
properties:
type:
type: string
description: Discriminator. Must be TEXT.
enum:
- TEXT
PlatformChatJsonSchemaFormat:
type: object
additionalProperties: false
description: Constrains the assistant response to a caller-supplied JSON Schema.
required:
- type
- name
- schema
properties:
type:
type: string
description: Discriminator. Must be JSON_SCHEMA.
enum:
- JSON_SCHEMA
name:
type: string
minLength: 1
maxLength: 64
description: A stable identifier for the schema.
description:
type: string
maxLength: 1024
description: An optional human-readable description of the schema.
schema:
type: object
additionalProperties: true
description: A JSON Schema object describing the desired output shape.
strict:
type: boolean
default: true
description: |
When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true.
PlatformChatCreateRequest:
type: object
additionalProperties: false
required:
- input
example:
input: What is our parental leave policy?
input: Summarize our parental leave policy as JSON.
text:
format:
type: JSON_SCHEMA
name: policy_summary
schema:
type: object
properties:
eligible_employees:
type: string
duration_weeks:
type: integer
required:
- eligible_employees
- duration_weeks
strict: true
properties:
input:
description: |
Expand All @@ -7477,6 +7708,18 @@ components:
minLength: 1
description: |
Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
text:
type: object
additionalProperties: false
description: |
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.
properties:
format:
description: |
Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema.
oneOf:
- $ref: "#/components/schemas/PlatformChatTextFormat"
- $ref: "#/components/schemas/PlatformChatJsonSchemaFormat"
PlatformChatStreamResponseId:
type: string
minLength: 1
Expand All @@ -7496,6 +7739,12 @@ components:
- OUTPUT_TEXT
text:
type: string
structured_output:
type:
- object
- "null"
description: |
Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`.
annotations:
type: array
items:
Expand Down Expand Up @@ -16128,6 +16377,8 @@ components:
- EDIT_DOC
- CHAT_TO_ARTIFACT
- SHARE_ARTIFACT
- CREATE_AGENT
- MANAGER_INVITE
description: Categories of content requested. An allowlist gives flexibility to request content separately or together.
requestOptions:
$ref: '#/components/schemas/FeedRequestOptions'
Expand Down Expand Up @@ -16603,6 +16854,8 @@ components:
- EDIT_DOC
- CHAT_TO_ARTIFACT
- SHARE_ARTIFACT
- CREATE_AGENT
- MANAGER_INVITE
description: Type of the justification.
justification:
type: string
Expand Down Expand Up @@ -16701,6 +16954,8 @@ components:
- EDIT_DOC
- CHAT_TO_ARTIFACT
- SHARE_ARTIFACT
- CREATE_AGENT
- MANAGER_INVITE
description: Category of the result, one of the requested categories in incoming request.
primaryEntry:
$ref: '#/components/schemas/FeedEntry'
Expand Down
37 changes: 36 additions & 1 deletion .speakeasy/tests.arazzo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159049,9 +159049,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 +159473,23 @@ 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
Loading
Loading