Skip to content

Commit bc218cb

Browse files
committed
## Python SDK Changes:
* `glean.client.chat.create()`: * `request.messages[].citations[].source_document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added** * `response` **Changed** (Breaking ⚠️) * `glean.client.pins.update()`: `response.attribution.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.announcements.update()`: * `request.body.structured_list[].document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added** * `response.body.structured_list[].document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added** * `glean.client.answers.create()`: * `request.data.added_roles[].group.type.enum(collection_audience)` **Added** * `response.added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.answers.update()`: * `request.added_roles[].group.type.enum(collection_audience)` **Added** * `response.added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.answers.retrieve()`: `response.answer_result.answer.added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.answers.list()`: `response.answer_results[].answer.added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.announcements.create()`: * `request.body.structured_list[].document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added** * `response.body.structured_list[].document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added** * `glean.client.chat.retrieve()`: `response.chat_result.chat.created_by.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.chat.list()`: `response.chat_results[].chat.created_by.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.chat.create_stream()`: * `request.messages[].citations[].source_document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added** * `glean.client.collections.add_items()`: `response.collection.added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.collections.create()`: * `request.added_roles[].group.type.enum(collection_audience)` **Added** * `response.union(class (0)).collection.added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.collections.delete_item()`: `response.collection.added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.collections.update()`: * `request.added_roles[].group.type.enum(collection_audience)` **Added** * `response.added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.collections.update_item()`: `response.collection.added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.collections.retrieve()`: `response.collection.added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.collections.list()`: `response.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.documents.retrieve()`: `response.documents.Map<DocumentOrError>.union(Document).metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added** * `glean.client.documents.retrieve_by_facets()`: `response.documents[].metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added** * `glean.client.insights.retrieve()`: `response.glean_assist.activity_insights[].user.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.pins.retrieve()`: `response.pin.attribution.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.messages.retrieve()`: `response.search_response.results[].structured_results[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.agents.create_agent()`: **Added** * `glean.client.pins.list()`: `response.pins[].attribution.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.pins.create()`: `response.attribution.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.search.query_as_admin()`: * `request.source_document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added** * `response.results[].structured_results[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.search.autocomplete()`: `response.results[].document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added** * `glean.client.search.retrieve_feed()`: * `request.categories[].enum(card_stack_promo)` **Added** * `response.results[]` **Changed** * `glean.client.search.recommendations()`: * `request.source_document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added** * `response.results[].structured_results[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.search.query()`: * `request.source_document.metadata.author.related_documents[].results[].structured_results[].custom_entity.roles[].group.type.enum(collection_audience)` **Added** * `response.results[].structured_results[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.entities.list()`: `response.results[].related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.entities.read_people()`: `response.results[].related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.shortcuts.create()`: * `request.data.added_roles[].group.type.enum(collection_audience)` **Added** * `response.shortcut.added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.shortcuts.retrieve()`: `response.shortcut.added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.shortcuts.list()`: `response.shortcuts[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.shortcuts.update()`: * `request.added_roles[].group.type.enum(collection_audience)` **Added** * `response.shortcut.added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.verification.add_reminder()`: `response.metadata.last_verifier.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.verification.list()`: `response.documents[].metadata.last_verifier.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.verification.verify()`: `response.metadata.last_verifier.related_documents[].query_suggestion.ranges[].document.metadata.collections[].added_roles[].group.type.enum(collection_audience)` **Added** * `glean.client.governance.data.policies.retrieve()`: `response.report.config.allowlist_options.regexes` **Added** * `glean.client.governance.data.policies.update()`: * `request.config.allowlist_options.regexes` **Added** * `glean.client.governance.data.policies.list()`: `response.reports[].config.allowlist_options.regexes` **Added** * `glean.client.governance.data.policies.create()`: * `request.config.allowlist_options.regexes` **Added** * `response.report.config.allowlist_options.regexes` **Added** * `glean.client.governance.data.reports.create()`: * `request.config.allowlist_options.regexes` **Added**
1 parent 8411597 commit bc218cb

71 files changed

Lines changed: 1721 additions & 648 deletions

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: 168 additions & 128 deletions
Large diffs are not rendered by default.

.speakeasy/gen.yaml

Lines changed: 6 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,10 @@ python:
5454
enableCustomCodeRegions: false
5555
enumFormat: enum
5656
envVarPrefix: GLEAN
57+
errorSchemaValidation: true
58+
eventStreamClassNames:
59+
async: EventStreamAsync
60+
sync: EventStream
5761
fixFlags:
5862
asyncPaginationSep2025: false
5963
conflictResistantModelImportsFeb2026: false
@@ -73,6 +77,7 @@ python:
7377
webhooks: ""
7478
inferUnionDiscriminators: true
7579
inputModelSuffix: input
80+
inputTypedDictSuffix: TypedDict
7681
legacyPyright: true
7782
license: ""
7883
maxMethodParams: 999

.speakeasy/glean-merged-spec.yaml

Lines changed: 150 additions & 64 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: e5874b89189ffca39bde70621d5ea19c1e418b92
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: 23532a93a618e97b01af0fd230491a9dc452c543
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:
@@ -1090,7 +1141,7 @@ paths:
10901141
text/event-stream:
10911142
schema:
10921143
type: string
1093-
description: The server will send a stream of events in server-sent events (SSE) format.
1144+
description: The server will send a stream of events in server-sent events (SSE) format. If execution fails after the stream has started, the stream may terminate with an error message in a normal `message` event.
10941145
example: |
10951146
id: 1
10961147
event: message
@@ -4658,6 +4709,8 @@ components:
46584709
APIToken:
46594710
scheme: bearer
46604711
type: http
4712+
description: >-
4713+
HTTP bearer token. Accepts a Glean-issued API token, an OAuth access token from the Glean OAuth Authorization Server (including Dynamic Client Registration clients), or an OAuth access token issued by an external identity provider. External-IdP OAuth tokens must also include the `X-Glean-Auth-Type: OAUTH` request header. OAuth is supported on the Client API only; the Indexing API requires a Glean-issued token.
46614714
schemas:
46624715
ActivityEventParams:
46634716
properties:
@@ -6002,6 +6055,8 @@ components:
60026055
GroupType:
60036056
type: string
60046057
description: The type of user group
6058+
x-enumDescriptions:
6059+
COLLECTION_AUDIENCE: Refers to any viewers of the Collection.
60056060
enum:
60066061
- DEPARTMENT
60076062
- ALL
@@ -6011,6 +6066,9 @@ components:
60116066
- LOCATION
60126067
- REGION
60136068
- EXTERNAL_GROUP
6069+
- COLLECTION_AUDIENCE
6070+
x-speakeasy-enum-descriptions:
6071+
COLLECTION_AUDIENCE: Refers to any viewers of the Collection.
60146072
Group:
60156073
required:
60166074
- type
@@ -8973,6 +9031,80 @@ components:
89739031
items:
89749032
type: string
89759033
description: IDs of files to delete.
9034+
WorkflowDraftableProperties:
9035+
properties:
9036+
name:
9037+
type: string
9038+
description: The name of the workflow.
9039+
WorkflowMutableProperties:
9040+
type: object
9041+
allOf:
9042+
- $ref: "#/components/schemas/WorkflowDraftableProperties"
9043+
- type: object
9044+
CreateWorkflowRequest:
9045+
allOf:
9046+
- $ref: "#/components/schemas/WorkflowMutableProperties"
9047+
- type: object
9048+
properties:
9049+
transient:
9050+
type: boolean
9051+
description: Used to create a transient workflow.
9052+
parentWorkflowId:
9053+
type: string
9054+
description: id of the parent workflow for transient workflows
9055+
WorkflowMetadata:
9056+
allOf:
9057+
- type: object
9058+
properties:
9059+
author:
9060+
$ref: "#/components/schemas/Person"
9061+
createTimestamp:
9062+
type: integer
9063+
description: Server Unix timestamp of the creation time.
9064+
lastUpdateTimestamp:
9065+
type: integer
9066+
description: Server Unix timestamp of the last update time.
9067+
lastDraftSavedAt:
9068+
type: integer
9069+
description: Server Unix timestamp of the last time the draft was saved.
9070+
lastDraftSavedBy:
9071+
description: The person who last saved the draft.
9072+
$ref: "#/components/schemas/Person"
9073+
lastDraftGitAuthorId:
9074+
type: string
9075+
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.
9076+
lastUpdatedBy:
9077+
$ref: "#/components/schemas/Person"
9078+
AttributionProperties: {}
9079+
Workflow:
9080+
allOf:
9081+
- $ref: "#/components/schemas/PermissionedObject"
9082+
- $ref: "#/components/schemas/WorkflowMutableProperties"
9083+
- $ref: "#/components/schemas/WorkflowMetadata"
9084+
- $ref: "#/components/schemas/AttributionProperties"
9085+
- type: object
9086+
properties:
9087+
id:
9088+
type: string
9089+
description: The ID of the workflow.
9090+
verified:
9091+
type: boolean
9092+
readOnly: true
9093+
description: When present, indicates this workflow is admin-verified. Set via the dedicated admin settings endpoint, not by regular edits.
9094+
showOrganizationAsAuthor:
9095+
type: boolean
9096+
readOnly: true
9097+
description: When true, displays organization name instead of author name in agent card. Set via the dedicated admin settings endpoint, not by regular edits.
9098+
WorkflowResult:
9099+
type: object
9100+
required:
9101+
- workflow
9102+
properties:
9103+
workflow:
9104+
$ref: "#/components/schemas/Workflow"
9105+
CreateWorkflowResponse:
9106+
allOf:
9107+
- $ref: "#/components/schemas/WorkflowResult"
89769108
Agent:
89779109
title: Agent
89789110
type: object
@@ -9025,16 +9157,6 @@ components:
90259157
message:
90269158
type: string
90279159
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
90389160
EditWorkflowRequest:
90399161
allOf:
90409162
- $ref: "#/components/schemas/WorkflowMutableProperties"
@@ -10985,6 +11107,7 @@ components:
1098511107
- MID_DAY_CATCH_UP
1098611108
- QUERY_SUGGESTION
1098711109
- COWORK_CUJ_PROMO
11110+
- CARD_STACK_PROMO
1098811111
- WEEKLY_MEETINGS
1098911112
- FOLLOW_UP
1099011113
- MILESTONE_TIMELINE_CHECK
@@ -11293,7 +11416,6 @@ components:
1129311416
description: A list of removed user roles for the Workflow.
1129411417
items:
1129511418
$ref: "#/components/schemas/UserRoleSpecification"
11296-
AttributionProperties: {}
1129711419
PromptTemplate:
1129811420
allOf:
1129911421
- $ref: "#/components/schemas/PromptTemplateMutableProperties"
@@ -11369,55 +11491,6 @@ components:
1136911491
runCount:
1137011492
$ref: "#/components/schemas/CountInfo"
1137111493
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"
1142111494
UserActivity:
1142211495
properties:
1142311496
actor:
@@ -11514,6 +11587,7 @@ components:
1151411587
- MID_DAY_CATCH_UP
1151511588
- QUERY_SUGGESTION
1151611589
- COWORK_CUJ_PROMO
11590+
- CARD_STACK_PROMO
1151711591
- WEEKLY_MEETINGS
1151811592
- FOLLOW_UP
1151911593
- MILESTONE_TIMELINE_CHECK
@@ -11602,6 +11676,7 @@ components:
1160211676
- MID_DAY_CATCH_UP
1160311677
- QUERY_SUGGESTION
1160411678
- COWORK_CUJ_PROMO
11679+
- CARD_STACK_PROMO
1160511680
- WEEKLY_MEETINGS
1160611681
- FOLLOW_UP
1160711682
- MILESTONE_TIMELINE_CHECK
@@ -11622,6 +11697,12 @@ components:
1162211697
rank:
1162311698
type: integer
1162411699
description: Rank of the result. Rank is suggested by server. Client side rank may differ.
11700+
placementReason:
11701+
type: string
11702+
enum:
11703+
- ORGANIC
11704+
- PROMO
11705+
description: Placement source for ranked feed results. ORGANIC means the card was emitted by normal feed ranking. PROMO means the card was inserted by the homepage cards promo framework.
1162511706
FeedResponse:
1162611707
required:
1162711708
- serverTimestamp
@@ -14272,7 +14353,12 @@ components:
1427214353
items:
1427314354
type: string
1427414355
description: list of words and phrases to consider as whitelisted content
14275-
description: Terms that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term in the allow-list, it will not be counted as a violation.
14356+
regexes:
14357+
type: array
14358+
items:
14359+
type: string
14360+
description: list of regular expressions whose matches are considered whitelisted content
14361+
description: Terms and regexes that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term, or matches a regex, in the allow-list, it will not be counted as a violation.
1427614362
DlpConfig:
1427714363
properties:
1427814364
version:

.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

0 commit comments

Comments
 (0)