From cdc0a1e3c41e0821e6f1e4c7d42f113d9990b126 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Mon, 29 Sep 2025 20:00:26 +0000 Subject: [PATCH 1/2] ## Python SDK Changes Detected: * `glean.client.insights.retrieve()`: `request` **Changed** --- .speakeasy/gen.lock | 23 +++- .speakeasy/gen.yaml | 2 +- .speakeasy/glean-merged-spec.yaml | 130 ++++++++++++++---- .speakeasy/workflow.lock | 14 +- README.md | 2 +- RELEASES.md | 12 +- docs/models/agentsinsightsv2request.md | 10 ++ docs/models/insightsassistantrequest.md | 9 ++ docs/models/insightsoverviewrequest.md | 9 ++ docs/models/insightsrequest.md | 21 +-- docs/models/insightsrequestcategory.md | 29 ++-- docs/sdks/insights/README.md | 33 ++--- pylintrc | 2 +- pyproject.toml | 2 +- speakeasyusagegen/.speakeasy/logs/naming.log | 7 +- src/glean/api_client/_version.py | 6 +- src/glean/api_client/agents.py | 16 +-- src/glean/api_client/insights.py | 80 +++++++++-- src/glean/api_client/models/__init__.py | 24 ++++ .../models/agentsinsightsv2request.py | 26 ++++ .../models/insightsassistantrequest.py | 21 +++ .../models/insightsoverviewrequest.py | 21 +++ .../api_client/models/insightsrequest.py | 65 +++++++-- .../components/agentsinsightsv2request.go | 32 +++++ .../components/insightsassistantrequest.go | 23 ++++ .../components/insightsoverviewrequest.go | 23 ++++ .../sdk/models/components/insightsrequest.go | 83 ++++++++--- 27 files changed, 586 insertions(+), 139 deletions(-) create mode 100644 docs/models/agentsinsightsv2request.md create mode 100644 docs/models/insightsassistantrequest.md create mode 100644 docs/models/insightsoverviewrequest.md create mode 100644 src/glean/api_client/models/agentsinsightsv2request.py create mode 100644 src/glean/api_client/models/insightsassistantrequest.py create mode 100644 src/glean/api_client/models/insightsoverviewrequest.py create mode 100644 tests/mockserver/internal/sdk/models/components/agentsinsightsv2request.go create mode 100644 tests/mockserver/internal/sdk/models/components/insightsassistantrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/insightsoverviewrequest.go diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 1e1c1655..49d03558 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 3e3290ca-0ee8-4981-b1bc-14536048fa63 management: - docChecksum: 11234d282481d3710e009ee7857573b0 + docChecksum: a1b9796a9df7b522bbca126ea657a92a docVersion: 0.9.0 - speakeasyVersion: 1.628.2 - generationVersion: 2.716.3 - releaseVersion: 0.8.1 - configChecksum: e18f0607a86d7edb15c7ab3679dee60e + speakeasyVersion: 1.631.4 + generationVersion: 2.716.16 + releaseVersion: 0.9.0 + configChecksum: 885838e10bfb05e9086d385baf889124 repoURL: https://github.com/gleanwork/api-client-python.git installationURL: https://github.com/gleanwork/api-client-python.git published: true @@ -69,6 +69,7 @@ generatedFiles: - docs/models/agentruncreate.md - docs/models/agentrunwaitresponse.md - docs/models/agentschemas.md + - docs/models/agentsinsightsv2request.md - docs/models/aiappactioncounts.md - docs/models/aiappsinsightsresponse.md - docs/models/aiinsightsresponse.md @@ -386,6 +387,8 @@ generatedFiles: - docs/models/inputschema.md - docs/models/insightsagentsrequestoptions.md - docs/models/insightsaiapprequestoptions.md + - docs/models/insightsassistantrequest.md + - docs/models/insightsoverviewrequest.md - docs/models/insightsrequest.md - docs/models/insightsrequestcategory.md - docs/models/insightsresponse.md @@ -709,6 +712,7 @@ generatedFiles: - src/glean/api_client/models/agentruncreate.py - src/glean/api_client/models/agentrunwaitresponse.py - src/glean/api_client/models/agentschemas.py + - src/glean/api_client/models/agentsinsightsv2request.py - src/glean/api_client/models/aiappactioncounts.py - src/glean/api_client/models/aiappsinsightsresponse.py - src/glean/api_client/models/aiinsightsresponse.py @@ -964,6 +968,8 @@ generatedFiles: - src/glean/api_client/models/inputoptions.py - src/glean/api_client/models/insightsagentsrequestoptions.py - src/glean/api_client/models/insightsaiapprequestoptions.py + - src/glean/api_client/models/insightsassistantrequest.py + - src/glean/api_client/models/insightsoverviewrequest.py - src/glean/api_client/models/insightsrequest.py - src/glean/api_client/models/insightsresponse.py - src/glean/api_client/models/invalidoperatorvalueerror.py @@ -1290,6 +1296,7 @@ generatedFiles: - tests/mockserver/internal/sdk/models/components/agentruncreate.go - tests/mockserver/internal/sdk/models/components/agentrunwaitresponse.go - tests/mockserver/internal/sdk/models/components/agentschemas.go + - tests/mockserver/internal/sdk/models/components/agentsinsightsv2request.go - tests/mockserver/internal/sdk/models/components/aiappactioncounts.go - tests/mockserver/internal/sdk/models/components/aiappsinsightsresponse.go - tests/mockserver/internal/sdk/models/components/aiinsightsresponse.go @@ -1528,6 +1535,8 @@ generatedFiles: - tests/mockserver/internal/sdk/models/components/inputoptions.go - tests/mockserver/internal/sdk/models/components/insightsagentsrequestoptions.go - tests/mockserver/internal/sdk/models/components/insightsaiapprequestoptions.go + - tests/mockserver/internal/sdk/models/components/insightsassistantrequest.go + - tests/mockserver/internal/sdk/models/components/insightsoverviewrequest.go - tests/mockserver/internal/sdk/models/components/insightsrequest.go - tests/mockserver/internal/sdk/models/components/insightsresponse.go - tests/mockserver/internal/sdk/models/components/invalidoperatorvalueerror.go @@ -2148,7 +2157,7 @@ examples: insights: speakeasy-default-insights: requestBody: - application/json: {"categories": ["COLLECTIONS"]} + application/json: {} responses: "200": application/json: {"users": {"activityInsights": [{"user": {"name": "George Clooney", "obfuscatedId": "abc123"}, "activity": "SEARCH"}], "inactiveInsights": [{"user": {"name": "George Clooney", "obfuscatedId": "abc123"}, "activity": "ALL"}]}, "content": {"documentInsights": [{"document": {"containerDocument": {"metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}, "parentDocument": {"metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}, "metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}}]}, "collections": {"documentInsights": [{"document": {"containerDocument": {"metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}, "parentDocument": {"metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}, "metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}}]}, "collectionsV2": {"documentInsights": [{"document": {"containerDocument": {"metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}, "parentDocument": {"metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}, "metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}}]}, "shortcuts": {"shortcutInsights": [{"shortcut": {"inputAlias": "", "addedRoles": [{"person": {"name": "George Clooney", "obfuscatedId": "abc123"}, "role": "VIEWER"}], "removedRoles": [{"person": {"name": "George Clooney", "obfuscatedId": "abc123"}, "role": "ANSWER_MODERATOR"}], "createdBy": {"name": "George Clooney", "obfuscatedId": "abc123"}, "updatedBy": {"name": "George Clooney", "obfuscatedId": "abc123"}, "destinationDocument": {"containerDocument": {"metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}, "parentDocument": {"metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}, "metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}, "roles": [{"person": {"name": "George Clooney", "obfuscatedId": "abc123"}, "role": "EDITOR"}]}}]}, "announcements": {"documentInsights": [{"document": {"containerDocument": {"metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}, "parentDocument": {"metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}, "metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}}]}, "answers": {"documentInsights": [{"document": {"containerDocument": {"metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}, "parentDocument": {"metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}, "metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "author": {"name": "name", "obfuscatedId": ""}, "components": ["Backend", "Networking"], "status": "[\"Done\"]", "customData": {"someCustomField": {}}}}}]}, "ai": {"assistantInsights": [{"user": {"name": "George Clooney", "obfuscatedId": "abc123"}, "activity": "SEARCH"}]}, "aiApps": {"aiAppInsights": [{"user": {"name": "George Clooney", "obfuscatedId": "abc123"}, "activity": "ALL"}]}, "gleanAssist": {"activityInsights": [{"user": {"name": "George Clooney", "obfuscatedId": "abc123"}, "activity": "SEARCH"}]}} @@ -2704,4 +2713,4 @@ generatedTests: updateshortcut: "2025-06-12T19:13:52-04:00" releaseNotes: | ## Python SDK Changes Detected: - * `glean.client.search.retrieve_feed()`: `response.results.[].primary_entry.digest.sections.[].channel_type` **Added** + * `glean.client.insights.retrieve()`: `request` **Changed** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 72d07d69..4daa999e 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -27,7 +27,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: true python: - version: 0.8.1 + version: 0.9.0 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index 2114919e..078b5cac 100644 --- a/.speakeasy/glean-merged-spec.yaml +++ b/.speakeasy/glean-merged-spec.yaml @@ -1366,8 +1366,8 @@ paths: post: tags: - Insights - summary: Read insights - description: Reads the aggregate information for each user, query, and content. + summary: Get insights + description: Gets the aggregate usage insights data displayed in the Insights Dashboards. operationId: insights x-visibility: Public x-codegen-request-body-name: payload @@ -1377,7 +1377,7 @@ paths: application/json: schema: $ref: "#/components/schemas/InsightsRequest" - description: Includes request params for insights dashboard data. + description: Includes request parameters for insights requests. required: true x-exportParamName: InsightsRequest responses: @@ -3190,6 +3190,7 @@ paths: description: Conflict x-speakeasy-name-override: upload x-speakeasy-group: indexing.shortcuts + /api/index/v1/debug/{datasource}/document/events: {} /rest/api/v1/governance/data/policies/{id}: get: description: Fetches the specified policy version, or the latest if no version is provided. @@ -8079,6 +8080,41 @@ components: cursor: type: string description: Cursor that indicates the start of the next page of results. To be passed in "more" requests for this query. + InsightsOverviewRequest: + properties: + departments: + type: array + items: + type: string + description: Departments for which Insights are requested. + dayRange: + $ref: "#/components/schemas/Period" + description: Time period for which Insights are requested. + InsightsAssistantRequest: + properties: + departments: + type: array + items: + type: string + description: Departments for which Insights are requested. + dayRange: + $ref: "#/components/schemas/Period" + description: Time period for which Insights are requested. + AgentsInsightsV2Request: + properties: + agentIds: + type: array + items: + type: string + description: IDs of the Agents for which Insights should be returned. An empty array signifies all. + departments: + type: array + items: + type: string + description: Departments for which Insights are requested. + dayRange: + $ref: "#/components/schemas/Period" + description: Time period for which Insights are requested. InsightsAiAppRequestOptions: type: object properties: @@ -8095,16 +8131,33 @@ components: items: type: string description: IDs of the Agents for which Insights should be returned. An empty array signifies all. - DownloadInsightsRequest: - required: - - categories + InsightsRequest: properties: + overviewRequest: + $ref: "#/components/schemas/InsightsOverviewRequest" + x-visibility: Public + description: If specified, will return data for the Overview section of the Insights Dashboard. + assistantRequest: + $ref: "#/components/schemas/InsightsAssistantRequest" + x-visibility: Public + description: If specified, will return data for the Assistant section of the Insights Dashboard. + agentsRequest: + $ref: "#/components/schemas/AgentsInsightsV2Request" + x-visibility: Public + description: If specified, will return data for the Agents section of the Insights Dashboard. + disablePerUserInsights: + type: boolean + description: If true, suppresses the generation of per-user Insights in the response. Default is false. categories: + deprecated: true type: array items: type: string enum: - AGENTS + - AGENT_USERS + - TOP_AGENTS + - AGENTS_USAGE_BY_DEPARTMENT - AI - AI_APPS - ANNOUNCEMENTS @@ -8117,34 +8170,31 @@ components: - USERS description: Categories of data requested. Request can include single or multiple types. departments: + deprecated: true type: array items: type: string description: Departments that the data is requested for. If this is empty, corresponds to whole company. dayRange: + deprecated: true $ref: "#/components/schemas/Period" aiAppRequestOptions: + deprecated: true $ref: "#/components/schemas/InsightsAiAppRequestOptions" agentsRequestOptions: + deprecated: true $ref: "#/components/schemas/InsightsAgentsRequestOptions" - InsightsRequest: - allOf: - - $ref: "#/components/schemas/DownloadInsightsRequest" - - type: object - properties: - assistantActivityTypes: - type: array - items: - type: string - enum: - - GLEAN_CHAT - - AI_SUMMARY - - AI_ANSWER - - GLEANBOT_RESPONSE - description: Types of activity that should count in the definition of an Assistant Active User. Affects only insights for AI category. - disablePerUserInsights: - type: boolean - description: If true, suppresses the generation of per-user Insights in the response. Default is false. + assistantActivityTypes: + deprecated: true + type: array + items: + type: string + enum: + - GLEAN_CHAT + - AI_SUMMARY + - AI_ANSWER + - GLEANBOT_RESPONSE + description: Types of activity that should count in the definition of an Assistant Active User. Affects only insights for AI category. LabeledCountInfo: required: - label @@ -11678,6 +11728,38 @@ components: - NOT_UPLOADED - STATUS_UNKNOWN example: UPLOADED + DebugDocumentLifecycleRequest: + type: object + description: Describes the request body of the /debug/{datasource}/document/events API call. + properties: + objectType: + type: string + description: Object type of the document to get lifecycle events for. + example: Article + docId: + type: string + description: Glean Document ID within the datasource to get lifecycle events for. + example: art123 + startDate: + type: string + description: The start date for events to be fetched. Cannot be more than 30 days (default 7 days) in the past. + example: "2025-05-01" + maxEvents: + type: integer + description: Max number of events to be fetched. Cannot be more than 100 (default 20). + example: 50 + required: + - objectType + - docId + DebugDocumentLifecycleResponse: + type: object + description: Describes the response body of the /debug/{datasource}/document/events API call + properties: + lifeCycleEvents: + type: array + description: List of lifecycle events corresponding to the document + items: + $ref: "#/components/schemas/LifeCycleEvent" PropertyDefinition: properties: name: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index fdfbdad9..fa799cc0 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,12 +1,12 @@ -speakeasyVersion: 1.628.2 +speakeasyVersion: 1.631.4 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:3dba87a7b61abaf1f2a6b645c2c9d1c5d79481f48ff3d57b2f1a864b8c8aa02f - sourceBlobDigest: sha256:49403d59f8446958ed5e813bbf322fda12ae91ed0991975bb0f24de0a189f74e + sourceRevisionDigest: sha256:1e44bd4133c298a0460c59b01703274d1c24c9fa389a311005a1f4be384921c3 + sourceBlobDigest: sha256:39b7061df492c752b341a36ebde421818f4e84d67a206f853c2558d6f3917fe3 tags: - latest - - speakeasy-sdk-regen-1758790482 + - speakeasy-sdk-regen-1758835054 Glean Client API: sourceNamespace: glean-client-api sourceRevisionDigest: sha256:4edc63ad559e4f2c9fb9ebf5edaaaaa9269f1874d271cfd84b441d6dacac43d2 @@ -17,10 +17,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:3dba87a7b61abaf1f2a6b645c2c9d1c5d79481f48ff3d57b2f1a864b8c8aa02f - sourceBlobDigest: sha256:49403d59f8446958ed5e813bbf322fda12ae91ed0991975bb0f24de0a189f74e + sourceRevisionDigest: sha256:1e44bd4133c298a0460c59b01703274d1c24c9fa389a311005a1f4be384921c3 + sourceBlobDigest: sha256:39b7061df492c752b341a36ebde421818f4e84d67a206f853c2558d6f3917fe3 codeSamplesNamespace: glean-api-specs-python-code-samples - codeSamplesRevisionDigest: sha256:f2603f30ecbb58faccb490a39011e91f26cad10f137200df87cd2348bb82fe6a + codeSamplesRevisionDigest: sha256:fa19a256472b0485c6a76dba325529c358221a18a36b916e1f04b5291d996854 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index da44e2a7..159315cd 100644 --- a/README.md +++ b/README.md @@ -427,7 +427,7 @@ For more information on obtaining the appropriate token type, please contact you #### [client.insights](docs/sdks/insights/README.md) -* [retrieve](docs/sdks/insights/README.md#retrieve) - Read insights +* [retrieve](docs/sdks/insights/README.md#retrieve) - Get insights #### [client.messages](docs/sdks/messages/README.md) diff --git a/RELEASES.md b/RELEASES.md index 63b3a3a8..f1294242 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -228,4 +228,14 @@ Based on: ### Generated - [python v0.8.1] . ### Releases -- [PyPI v0.8.1] https://pypi.org/project/glean/0.8.1 - . \ No newline at end of file +- [PyPI v0.8.1] https://pypi.org/project/glean/0.8.1 - . + +## 2025-09-29 19:57:09 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.631.4 (2.716.16) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.9.0] . +### Releases +- [PyPI v0.9.0] https://pypi.org/project/glean/0.9.0 - . \ No newline at end of file diff --git a/docs/models/agentsinsightsv2request.md b/docs/models/agentsinsightsv2request.md new file mode 100644 index 00000000..fc4a769f --- /dev/null +++ b/docs/models/agentsinsightsv2request.md @@ -0,0 +1,10 @@ +# AgentsInsightsV2Request + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `agent_ids` | List[*str*] | :heavy_minus_sign: | IDs of the Agents for which Insights should be returned. An empty array signifies all. | +| `departments` | List[*str*] | :heavy_minus_sign: | Departments for which Insights are requested. | +| `day_range` | [Optional[models.Period]](../models/period.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/insightsassistantrequest.md b/docs/models/insightsassistantrequest.md new file mode 100644 index 00000000..83e8e5b1 --- /dev/null +++ b/docs/models/insightsassistantrequest.md @@ -0,0 +1,9 @@ +# InsightsAssistantRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `departments` | List[*str*] | :heavy_minus_sign: | Departments for which Insights are requested. | +| `day_range` | [Optional[models.Period]](../models/period.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/insightsoverviewrequest.md b/docs/models/insightsoverviewrequest.md new file mode 100644 index 00000000..90e12f31 --- /dev/null +++ b/docs/models/insightsoverviewrequest.md @@ -0,0 +1,9 @@ +# InsightsOverviewRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `departments` | List[*str*] | :heavy_minus_sign: | Departments for which Insights are requested. | +| `day_range` | [Optional[models.Period]](../models/period.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/insightsrequest.md b/docs/models/insightsrequest.md index 736ad3ff..b9c2ea45 100644 --- a/docs/models/insightsrequest.md +++ b/docs/models/insightsrequest.md @@ -3,12 +3,15 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `categories` | List[[models.InsightsRequestCategory](../models/insightsrequestcategory.md)] | :heavy_check_mark: | Categories of data requested. Request can include single or multiple types. | -| `departments` | List[*str*] | :heavy_minus_sign: | Departments that the data is requested for. If this is empty, corresponds to whole company. | -| `day_range` | [Optional[models.Period]](../models/period.md) | :heavy_minus_sign: | N/A | -| `ai_app_request_options` | [Optional[models.InsightsAiAppRequestOptions]](../models/insightsaiapprequestoptions.md) | :heavy_minus_sign: | N/A | -| `agents_request_options` | [Optional[models.InsightsAgentsRequestOptions]](../models/insightsagentsrequestoptions.md) | :heavy_minus_sign: | N/A | -| `assistant_activity_types` | List[[models.AssistantActivityType](../models/assistantactivitytype.md)] | :heavy_minus_sign: | Types of activity that should count in the definition of an Assistant Active User. Affects only insights for AI category. | -| `disable_per_user_insights` | *Optional[bool]* | :heavy_minus_sign: | If true, suppresses the generation of per-user Insights in the response. Default is false. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `overview_request` | [Optional[models.InsightsOverviewRequest]](../models/insightsoverviewrequest.md) | :heavy_minus_sign: | N/A | +| `assistant_request` | [Optional[models.InsightsAssistantRequest]](../models/insightsassistantrequest.md) | :heavy_minus_sign: | N/A | +| `agents_request` | [Optional[models.AgentsInsightsV2Request]](../models/agentsinsightsv2request.md) | :heavy_minus_sign: | N/A | +| `disable_per_user_insights` | *Optional[bool]* | :heavy_minus_sign: | If true, suppresses the generation of per-user Insights in the response. Default is false. | +| ~~`categories`~~ | List[[models.InsightsRequestCategory](../models/insightsrequestcategory.md)] | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Categories of data requested. Request can include single or multiple types. | +| ~~`departments`~~ | List[*str*] | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Departments that the data is requested for. If this is empty, corresponds to whole company. | +| `day_range` | [Optional[models.Period]](../models/period.md) | :heavy_minus_sign: | N/A | +| `ai_app_request_options` | [Optional[models.InsightsAiAppRequestOptions]](../models/insightsaiapprequestoptions.md) | :heavy_minus_sign: | N/A | +| `agents_request_options` | [Optional[models.InsightsAgentsRequestOptions]](../models/insightsagentsrequestoptions.md) | :heavy_minus_sign: | N/A | +| ~~`assistant_activity_types`~~ | List[[models.AssistantActivityType](../models/assistantactivitytype.md)] | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Types of activity that should count in the definition of an Assistant Active User. Affects only insights for AI category. | \ No newline at end of file diff --git a/docs/models/insightsrequestcategory.md b/docs/models/insightsrequestcategory.md index 216c1d6b..f5831a04 100644 --- a/docs/models/insightsrequestcategory.md +++ b/docs/models/insightsrequestcategory.md @@ -3,16 +3,19 @@ ## Values -| Name | Value | -| --------------- | --------------- | -| `AGENTS` | AGENTS | -| `AI` | AI | -| `AI_APPS` | AI_APPS | -| `ANNOUNCEMENTS` | ANNOUNCEMENTS | -| `ANSWERS` | ANSWERS | -| `COLLECTIONS` | COLLECTIONS | -| `CONTENT` | CONTENT | -| `GLEAN_ASSIST` | GLEAN_ASSIST | -| `QUERIES` | QUERIES | -| `SHORTCUTS` | SHORTCUTS | -| `USERS` | USERS | \ No newline at end of file +| Name | Value | +| ---------------------------- | ---------------------------- | +| `AGENTS` | AGENTS | +| `AGENT_USERS` | AGENT_USERS | +| `TOP_AGENTS` | TOP_AGENTS | +| `AGENTS_USAGE_BY_DEPARTMENT` | AGENTS_USAGE_BY_DEPARTMENT | +| `AI` | AI | +| `AI_APPS` | AI_APPS | +| `ANNOUNCEMENTS` | ANNOUNCEMENTS | +| `ANSWERS` | ANSWERS | +| `COLLECTIONS` | COLLECTIONS | +| `CONTENT` | CONTENT | +| `GLEAN_ASSIST` | GLEAN_ASSIST | +| `QUERIES` | QUERIES | +| `SHORTCUTS` | SHORTCUTS | +| `USERS` | USERS | \ No newline at end of file diff --git a/docs/sdks/insights/README.md b/docs/sdks/insights/README.md index 3a8de827..76c3d68f 100644 --- a/docs/sdks/insights/README.md +++ b/docs/sdks/insights/README.md @@ -5,17 +5,17 @@ ### Available Operations -* [retrieve](#retrieve) - Read insights +* [retrieve](#retrieve) - Get insights ## retrieve -Reads the aggregate information for each user, query, and content. +Gets the aggregate usage insights data displayed in the Insights Dashboards. ### Example Usage ```python -from glean.api_client import Glean, models +from glean.api_client import Glean import os @@ -23,9 +23,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - res = glean.client.insights.retrieve(categories=[ - models.InsightsRequestCategory.COLLECTIONS, - ]) + res = glean.client.insights.retrieve() # Handle response print(res) @@ -34,16 +32,19 @@ with Glean( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `categories` | List[[models.InsightsRequestCategory](../../models/insightsrequestcategory.md)] | :heavy_check_mark: | Categories of data requested. Request can include single or multiple types. | -| `departments` | List[*str*] | :heavy_minus_sign: | Departments that the data is requested for. If this is empty, corresponds to whole company. | -| `day_range` | [Optional[models.Period]](../../models/period.md) | :heavy_minus_sign: | N/A | -| `ai_app_request_options` | [Optional[models.InsightsAiAppRequestOptions]](../../models/insightsaiapprequestoptions.md) | :heavy_minus_sign: | N/A | -| `agents_request_options` | [Optional[models.InsightsAgentsRequestOptions]](../../models/insightsagentsrequestoptions.md) | :heavy_minus_sign: | N/A | -| `assistant_activity_types` | List[[models.AssistantActivityType](../../models/assistantactivitytype.md)] | :heavy_minus_sign: | Types of activity that should count in the definition of an Assistant Active User. Affects only insights for AI category. | -| `disable_per_user_insights` | *Optional[bool]* | :heavy_minus_sign: | If true, suppresses the generation of per-user Insights in the response. Default is false. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `overview_request` | [Optional[models.InsightsOverviewRequest]](../../models/insightsoverviewrequest.md) | :heavy_minus_sign: | N/A | +| `assistant_request` | [Optional[models.InsightsAssistantRequest]](../../models/insightsassistantrequest.md) | :heavy_minus_sign: | N/A | +| `agents_request` | [Optional[models.AgentsInsightsV2Request]](../../models/agentsinsightsv2request.md) | :heavy_minus_sign: | N/A | +| `disable_per_user_insights` | *Optional[bool]* | :heavy_minus_sign: | If true, suppresses the generation of per-user Insights in the response. Default is false. | +| `categories` | List[[models.InsightsRequestCategory](../../models/insightsrequestcategory.md)] | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Categories of data requested. Request can include single or multiple types. | +| `departments` | List[*str*] | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Departments that the data is requested for. If this is empty, corresponds to whole company. | +| `day_range` | [Optional[models.Period]](../../models/period.md) | :heavy_minus_sign: | N/A | +| `ai_app_request_options` | [Optional[models.InsightsAiAppRequestOptions]](../../models/insightsaiapprequestoptions.md) | :heavy_minus_sign: | N/A | +| `agents_request_options` | [Optional[models.InsightsAgentsRequestOptions]](../../models/insightsagentsrequestoptions.md) | :heavy_minus_sign: | N/A | +| `assistant_activity_types` | List[[models.AssistantActivityType](../../models/assistantactivitytype.md)] | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Types of activity that should count in the definition of an Assistant Active User. Affects only insights for AI category. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/pylintrc b/pylintrc index b767620c..8e34b78a 100644 --- a/pylintrc +++ b/pylintrc @@ -642,7 +642,7 @@ additional-builtins= allow-global-unused-variables=yes # List of names allowed to shadow builtins -allowed-redefined-builtins=id,object +allowed-redefined-builtins=id,object,input # List of strings which can identify a callback function by name. A callback # name must start or end with one of those strings. diff --git a/pyproject.toml b/pyproject.toml index de25fd57..5dcc43f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "glean-api-client" -version = "0.8.1" +version = "0.9.0" description = "Python Client SDK Generated by Speakeasy." authors = [{ name = "Glean Technologies, Inc." }] license = "MIT" diff --git a/speakeasyusagegen/.speakeasy/logs/naming.log b/speakeasyusagegen/.speakeasy/logs/naming.log index a56cf20f..4effb771 100644 --- a/speakeasyusagegen/.speakeasy/logs/naming.log +++ b/speakeasyusagegen/.speakeasy/logs/naming.log @@ -728,8 +728,11 @@ SummarizeResponse (HttpMeta: HTTPMetadata, SummarizeResponse: SummarizeResponse) Error (message: string) Summary (text: string, followUpPrompts: array) Insights (SDK empty) -InsightsRequest (categories: array, departments: array, dayRange: Period ...) - InsightsRequestCategory (enum: AGENTS, AI, AI_APPS ...) +InsightsRequest (overviewRequest: InsightsOverviewRequest, assistantRequest: InsightsAssistantRequest, agentsRequest: AgentsInsightsV2Request ...) + InsightsOverviewRequest (departments: array, dayRange: Period) + InsightsAssistantRequest (departments: array, dayRange: Period) + AgentsInsightsV2Request (agentIds: array, departments: array, dayRange: Period) + InsightsRequestCategory (enum: AGENTS, AGENT_USERS, TOP_AGENTS ...) InsightsAiAppRequestOptions (aiAppIds: array) InsightsAgentsRequestOptions (agentIds: array) AssistantActivityType (enum: GLEAN_CHAT, AI_SUMMARY, AI_ANSWER ...) diff --git a/src/glean/api_client/_version.py b/src/glean/api_client/_version.py index e7e7c156..8c2339a9 100644 --- a/src/glean/api_client/_version.py +++ b/src/glean/api_client/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "glean" -__version__: str = "0.8.1" +__version__: str = "0.9.0" __openapi_doc_version__: str = "0.9.0" -__gen_version__: str = "2.716.3" -__user_agent__: str = "speakeasy-sdk/python 0.8.1 2.716.3 0.9.0 glean" +__gen_version__: str = "2.716.16" +__user_agent__: str = "speakeasy-sdk/python 0.9.0 2.716.16 0.9.0 glean" try: if __package__ is not None: diff --git a/src/glean/api_client/agents.py b/src/glean/api_client/agents.py index 82d9f432..062f3c7b 100644 --- a/src/glean/api_client/agents.py +++ b/src/glean/api_client/agents.py @@ -530,7 +530,7 @@ def run_stream( self, *, agent_id: str, - input_: Optional[Dict[str, Any]] = None, + input: Optional[Dict[str, Any]] = None, messages: Optional[ Union[List[models.Message], List[models.MessageTypedDict]] ] = None, @@ -565,7 +565,7 @@ def run_stream( request = models.AgentRunCreate( agent_id=agent_id, - input=input_, + input=input, messages=utils.get_pydantic_model(messages, Optional[List[models.Message]]), metadata=metadata, ) @@ -629,7 +629,7 @@ async def run_stream_async( self, *, agent_id: str, - input_: Optional[Dict[str, Any]] = None, + input: Optional[Dict[str, Any]] = None, messages: Optional[ Union[List[models.Message], List[models.MessageTypedDict]] ] = None, @@ -664,7 +664,7 @@ async def run_stream_async( request = models.AgentRunCreate( agent_id=agent_id, - input=input_, + input=input, messages=utils.get_pydantic_model(messages, Optional[List[models.Message]]), metadata=metadata, ) @@ -728,7 +728,7 @@ def run( self, *, agent_id: str, - input_: Optional[Dict[str, Any]] = None, + input: Optional[Dict[str, Any]] = None, messages: Optional[ Union[List[models.Message], List[models.MessageTypedDict]] ] = None, @@ -763,7 +763,7 @@ def run( request = models.AgentRunCreate( agent_id=agent_id, - input=input_, + input=input, messages=utils.get_pydantic_model(messages, Optional[List[models.Message]]), metadata=metadata, ) @@ -827,7 +827,7 @@ async def run_async( self, *, agent_id: str, - input_: Optional[Dict[str, Any]] = None, + input: Optional[Dict[str, Any]] = None, messages: Optional[ Union[List[models.Message], List[models.MessageTypedDict]] ] = None, @@ -862,7 +862,7 @@ async def run_async( request = models.AgentRunCreate( agent_id=agent_id, - input=input_, + input=input, messages=utils.get_pydantic_model(messages, Optional[List[models.Message]]), metadata=metadata, ) diff --git a/src/glean/api_client/insights.py b/src/glean/api_client/insights.py index 7c92ed33..632c39f0 100644 --- a/src/glean/api_client/insights.py +++ b/src/glean/api_client/insights.py @@ -13,7 +13,24 @@ class Insights(BaseSDK): def retrieve( self, *, - categories: List[models.InsightsRequestCategory], + overview_request: Optional[ + Union[ + models.InsightsOverviewRequest, models.InsightsOverviewRequestTypedDict + ] + ] = None, + assistant_request: Optional[ + Union[ + models.InsightsAssistantRequest, + models.InsightsAssistantRequestTypedDict, + ] + ] = None, + agents_request: Optional[ + Union[ + models.AgentsInsightsV2Request, models.AgentsInsightsV2RequestTypedDict + ] + ] = None, + disable_per_user_insights: Optional[bool] = None, + categories: Optional[List[models.InsightsRequestCategory]] = None, departments: Optional[List[str]] = None, day_range: Optional[Union[models.Period, models.PeriodTypedDict]] = None, ai_app_request_options: Optional[ @@ -29,23 +46,25 @@ def retrieve( ] ] = None, assistant_activity_types: Optional[List[models.AssistantActivityType]] = None, - disable_per_user_insights: Optional[bool] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> models.InsightsResponse: - r"""Read insights + r"""Get insights - Reads the aggregate information for each user, query, and content. + Gets the aggregate usage insights data displayed in the Insights Dashboards. + :param overview_request: + :param assistant_request: + :param agents_request: + :param disable_per_user_insights: If true, suppresses the generation of per-user Insights in the response. Default is false. :param categories: Categories of data requested. Request can include single or multiple types. :param departments: Departments that the data is requested for. If this is empty, corresponds to whole company. :param day_range: :param ai_app_request_options: :param agents_request_options: :param assistant_activity_types: Types of activity that should count in the definition of an Assistant Active User. Affects only insights for AI category. - :param disable_per_user_insights: If true, suppresses the generation of per-user Insights in the response. Default is false. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -62,6 +81,16 @@ def retrieve( base_url = self._get_url(base_url, url_variables) request = models.InsightsRequest( + overview_request=utils.get_pydantic_model( + overview_request, Optional[models.InsightsOverviewRequest] + ), + assistant_request=utils.get_pydantic_model( + assistant_request, Optional[models.InsightsAssistantRequest] + ), + agents_request=utils.get_pydantic_model( + agents_request, Optional[models.AgentsInsightsV2Request] + ), + disable_per_user_insights=disable_per_user_insights, categories=categories, departments=departments, day_range=utils.get_pydantic_model(day_range, Optional[models.Period]), @@ -72,7 +101,6 @@ def retrieve( agents_request_options, Optional[models.InsightsAgentsRequestOptions] ), assistant_activity_types=assistant_activity_types, - disable_per_user_insights=disable_per_user_insights, ) req = self._build_request( @@ -131,7 +159,24 @@ def retrieve( async def retrieve_async( self, *, - categories: List[models.InsightsRequestCategory], + overview_request: Optional[ + Union[ + models.InsightsOverviewRequest, models.InsightsOverviewRequestTypedDict + ] + ] = None, + assistant_request: Optional[ + Union[ + models.InsightsAssistantRequest, + models.InsightsAssistantRequestTypedDict, + ] + ] = None, + agents_request: Optional[ + Union[ + models.AgentsInsightsV2Request, models.AgentsInsightsV2RequestTypedDict + ] + ] = None, + disable_per_user_insights: Optional[bool] = None, + categories: Optional[List[models.InsightsRequestCategory]] = None, departments: Optional[List[str]] = None, day_range: Optional[Union[models.Period, models.PeriodTypedDict]] = None, ai_app_request_options: Optional[ @@ -147,23 +192,25 @@ async def retrieve_async( ] ] = None, assistant_activity_types: Optional[List[models.AssistantActivityType]] = None, - disable_per_user_insights: Optional[bool] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> models.InsightsResponse: - r"""Read insights + r"""Get insights - Reads the aggregate information for each user, query, and content. + Gets the aggregate usage insights data displayed in the Insights Dashboards. + :param overview_request: + :param assistant_request: + :param agents_request: + :param disable_per_user_insights: If true, suppresses the generation of per-user Insights in the response. Default is false. :param categories: Categories of data requested. Request can include single or multiple types. :param departments: Departments that the data is requested for. If this is empty, corresponds to whole company. :param day_range: :param ai_app_request_options: :param agents_request_options: :param assistant_activity_types: Types of activity that should count in the definition of an Assistant Active User. Affects only insights for AI category. - :param disable_per_user_insights: If true, suppresses the generation of per-user Insights in the response. Default is false. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -180,6 +227,16 @@ async def retrieve_async( base_url = self._get_url(base_url, url_variables) request = models.InsightsRequest( + overview_request=utils.get_pydantic_model( + overview_request, Optional[models.InsightsOverviewRequest] + ), + assistant_request=utils.get_pydantic_model( + assistant_request, Optional[models.InsightsAssistantRequest] + ), + agents_request=utils.get_pydantic_model( + agents_request, Optional[models.AgentsInsightsV2Request] + ), + disable_per_user_insights=disable_per_user_insights, categories=categories, departments=departments, day_range=utils.get_pydantic_model(day_range, Optional[models.Period]), @@ -190,7 +247,6 @@ async def retrieve_async( agents_request_options, Optional[models.InsightsAgentsRequestOptions] ), assistant_activity_types=assistant_activity_types, - disable_per_user_insights=disable_per_user_insights, ) req = self._build_request_async( diff --git a/src/glean/api_client/models/__init__.py b/src/glean/api_client/models/__init__.py index 2c59c6ca..2c797a65 100644 --- a/src/glean/api_client/models/__init__.py +++ b/src/glean/api_client/models/__init__.py @@ -122,6 +122,10 @@ OutputSchema, OutputSchemaTypedDict, ) + from .agentsinsightsv2request import ( + AgentsInsightsV2Request, + AgentsInsightsV2RequestTypedDict, + ) from .aiappactioncounts import AiAppActionCounts, AiAppActionCountsTypedDict from .aiappsinsightsresponse import ( AiAppsInsightsResponse, @@ -791,6 +795,14 @@ InsightsAiAppRequestOptions, InsightsAiAppRequestOptionsTypedDict, ) + from .insightsassistantrequest import ( + InsightsAssistantRequest, + InsightsAssistantRequestTypedDict, + ) + from .insightsoverviewrequest import ( + InsightsOverviewRequest, + InsightsOverviewRequestTypedDict, + ) from .insightsrequest import ( AssistantActivityType, InsightsRequest, @@ -1276,6 +1288,8 @@ "AgentSchemas", "AgentSchemasTypedDict", "AgentTypedDict", + "AgentsInsightsV2Request", + "AgentsInsightsV2RequestTypedDict", "AiAppActionCounts", "AiAppActionCountsTypedDict", "AiAppsInsightsResponse", @@ -1846,6 +1860,10 @@ "InsightsAgentsRequestOptionsTypedDict", "InsightsAiAppRequestOptions", "InsightsAiAppRequestOptionsTypedDict", + "InsightsAssistantRequest", + "InsightsAssistantRequestTypedDict", + "InsightsOverviewRequest", + "InsightsOverviewRequestTypedDict", "InsightsRequest", "InsightsRequestCategory", "InsightsRequestTypedDict", @@ -2302,6 +2320,8 @@ "InputSchemaTypedDict": ".agentschemas", "OutputSchema": ".agentschemas", "OutputSchemaTypedDict": ".agentschemas", + "AgentsInsightsV2Request": ".agentsinsightsv2request", + "AgentsInsightsV2RequestTypedDict": ".agentsinsightsv2request", "AiAppActionCounts": ".aiappactioncounts", "AiAppActionCountsTypedDict": ".aiappactioncounts", "AiAppsInsightsResponse": ".aiappsinsightsresponse", @@ -2827,6 +2847,10 @@ "InsightsAgentsRequestOptionsTypedDict": ".insightsagentsrequestoptions", "InsightsAiAppRequestOptions": ".insightsaiapprequestoptions", "InsightsAiAppRequestOptionsTypedDict": ".insightsaiapprequestoptions", + "InsightsAssistantRequest": ".insightsassistantrequest", + "InsightsAssistantRequestTypedDict": ".insightsassistantrequest", + "InsightsOverviewRequest": ".insightsoverviewrequest", + "InsightsOverviewRequestTypedDict": ".insightsoverviewrequest", "AssistantActivityType": ".insightsrequest", "InsightsRequest": ".insightsrequest", "InsightsRequestCategory": ".insightsrequest", diff --git a/src/glean/api_client/models/agentsinsightsv2request.py b/src/glean/api_client/models/agentsinsightsv2request.py new file mode 100644 index 00000000..9bfc6dc3 --- /dev/null +++ b/src/glean/api_client/models/agentsinsightsv2request.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .period import Period, PeriodTypedDict +from glean.api_client.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AgentsInsightsV2RequestTypedDict(TypedDict): + agent_ids: NotRequired[List[str]] + r"""IDs of the Agents for which Insights should be returned. An empty array signifies all.""" + departments: NotRequired[List[str]] + r"""Departments for which Insights are requested.""" + day_range: NotRequired[PeriodTypedDict] + + +class AgentsInsightsV2Request(BaseModel): + agent_ids: Annotated[Optional[List[str]], pydantic.Field(alias="agentIds")] = None + r"""IDs of the Agents for which Insights should be returned. An empty array signifies all.""" + + departments: Optional[List[str]] = None + r"""Departments for which Insights are requested.""" + + day_range: Annotated[Optional[Period], pydantic.Field(alias="dayRange")] = None diff --git a/src/glean/api_client/models/insightsassistantrequest.py b/src/glean/api_client/models/insightsassistantrequest.py new file mode 100644 index 00000000..a42ec5e3 --- /dev/null +++ b/src/glean/api_client/models/insightsassistantrequest.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .period import Period, PeriodTypedDict +from glean.api_client.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class InsightsAssistantRequestTypedDict(TypedDict): + departments: NotRequired[List[str]] + r"""Departments for which Insights are requested.""" + day_range: NotRequired[PeriodTypedDict] + + +class InsightsAssistantRequest(BaseModel): + departments: Optional[List[str]] = None + r"""Departments for which Insights are requested.""" + + day_range: Annotated[Optional[Period], pydantic.Field(alias="dayRange")] = None diff --git a/src/glean/api_client/models/insightsoverviewrequest.py b/src/glean/api_client/models/insightsoverviewrequest.py new file mode 100644 index 00000000..1c6f8a40 --- /dev/null +++ b/src/glean/api_client/models/insightsoverviewrequest.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .period import Period, PeriodTypedDict +from glean.api_client.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class InsightsOverviewRequestTypedDict(TypedDict): + departments: NotRequired[List[str]] + r"""Departments for which Insights are requested.""" + day_range: NotRequired[PeriodTypedDict] + + +class InsightsOverviewRequest(BaseModel): + departments: Optional[List[str]] = None + r"""Departments for which Insights are requested.""" + + day_range: Annotated[Optional[Period], pydantic.Field(alias="dayRange")] = None diff --git a/src/glean/api_client/models/insightsrequest.py b/src/glean/api_client/models/insightsrequest.py index b7ade2c6..01f03273 100644 --- a/src/glean/api_client/models/insightsrequest.py +++ b/src/glean/api_client/models/insightsrequest.py @@ -1,6 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .agentsinsightsv2request import ( + AgentsInsightsV2Request, + AgentsInsightsV2RequestTypedDict, +) from .insightsagentsrequestoptions import ( InsightsAgentsRequestOptions, InsightsAgentsRequestOptionsTypedDict, @@ -9,6 +13,14 @@ InsightsAiAppRequestOptions, InsightsAiAppRequestOptionsTypedDict, ) +from .insightsassistantrequest import ( + InsightsAssistantRequest, + InsightsAssistantRequestTypedDict, +) +from .insightsoverviewrequest import ( + InsightsOverviewRequest, + InsightsOverviewRequestTypedDict, +) from .period import Period, PeriodTypedDict from enum import Enum from glean.api_client.types import BaseModel @@ -19,6 +31,9 @@ class InsightsRequestCategory(str, Enum): AGENTS = "AGENTS" + AGENT_USERS = "AGENT_USERS" + TOP_AGENTS = "TOP_AGENTS" + AGENTS_USAGE_BY_DEPARTMENT = "AGENTS_USAGE_BY_DEPARTMENT" AI = "AI" AI_APPS = "AI_APPS" ANNOUNCEMENTS = "ANNOUNCEMENTS" @@ -39,7 +54,12 @@ class AssistantActivityType(str, Enum): class InsightsRequestTypedDict(TypedDict): - categories: List[InsightsRequestCategory] + overview_request: NotRequired[InsightsOverviewRequestTypedDict] + assistant_request: NotRequired[InsightsAssistantRequestTypedDict] + agents_request: NotRequired[AgentsInsightsV2RequestTypedDict] + disable_per_user_insights: NotRequired[bool] + r"""If true, suppresses the generation of per-user Insights in the response. Default is false.""" + categories: NotRequired[List[InsightsRequestCategory]] r"""Categories of data requested. Request can include single or multiple types.""" departments: NotRequired[List[str]] r"""Departments that the data is requested for. If this is empty, corresponds to whole company.""" @@ -48,15 +68,40 @@ class InsightsRequestTypedDict(TypedDict): agents_request_options: NotRequired[InsightsAgentsRequestOptionsTypedDict] assistant_activity_types: NotRequired[List[AssistantActivityType]] r"""Types of activity that should count in the definition of an Assistant Active User. Affects only insights for AI category.""" - disable_per_user_insights: NotRequired[bool] - r"""If true, suppresses the generation of per-user Insights in the response. Default is false.""" class InsightsRequest(BaseModel): - categories: List[InsightsRequestCategory] + overview_request: Annotated[ + Optional[InsightsOverviewRequest], pydantic.Field(alias="overviewRequest") + ] = None + + assistant_request: Annotated[ + Optional[InsightsAssistantRequest], pydantic.Field(alias="assistantRequest") + ] = None + + agents_request: Annotated[ + Optional[AgentsInsightsV2Request], pydantic.Field(alias="agentsRequest") + ] = None + + disable_per_user_insights: Annotated[ + Optional[bool], pydantic.Field(alias="disablePerUserInsights") + ] = None + r"""If true, suppresses the generation of per-user Insights in the response. Default is false.""" + + categories: Annotated[ + Optional[List[InsightsRequestCategory]], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] = None r"""Categories of data requested. Request can include single or multiple types.""" - departments: Optional[List[str]] = None + departments: Annotated[ + Optional[List[str]], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] = None r"""Departments that the data is requested for. If this is empty, corresponds to whole company.""" day_range: Annotated[Optional[Period], pydantic.Field(alias="dayRange")] = None @@ -73,11 +118,9 @@ class InsightsRequest(BaseModel): assistant_activity_types: Annotated[ Optional[List[AssistantActivityType]], - pydantic.Field(alias="assistantActivityTypes"), + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="assistantActivityTypes", + ), ] = None r"""Types of activity that should count in the definition of an Assistant Active User. Affects only insights for AI category.""" - - disable_per_user_insights: Annotated[ - Optional[bool], pydantic.Field(alias="disablePerUserInsights") - ] = None - r"""If true, suppresses the generation of per-user Insights in the response. Default is false.""" diff --git a/tests/mockserver/internal/sdk/models/components/agentsinsightsv2request.go b/tests/mockserver/internal/sdk/models/components/agentsinsightsv2request.go new file mode 100644 index 00000000..30af15e6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/agentsinsightsv2request.go @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AgentsInsightsV2Request struct { + // IDs of the Agents for which Insights should be returned. An empty array signifies all. + AgentIds []string `json:"agentIds,omitempty"` + // Departments for which Insights are requested. + Departments []string `json:"departments,omitempty"` + DayRange *Period `json:"dayRange,omitempty"` +} + +func (o *AgentsInsightsV2Request) GetAgentIds() []string { + if o == nil { + return nil + } + return o.AgentIds +} + +func (o *AgentsInsightsV2Request) GetDepartments() []string { + if o == nil { + return nil + } + return o.Departments +} + +func (o *AgentsInsightsV2Request) GetDayRange() *Period { + if o == nil { + return nil + } + return o.DayRange +} diff --git a/tests/mockserver/internal/sdk/models/components/insightsassistantrequest.go b/tests/mockserver/internal/sdk/models/components/insightsassistantrequest.go new file mode 100644 index 00000000..6d54c660 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/insightsassistantrequest.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type InsightsAssistantRequest struct { + // Departments for which Insights are requested. + Departments []string `json:"departments,omitempty"` + DayRange *Period `json:"dayRange,omitempty"` +} + +func (o *InsightsAssistantRequest) GetDepartments() []string { + if o == nil { + return nil + } + return o.Departments +} + +func (o *InsightsAssistantRequest) GetDayRange() *Period { + if o == nil { + return nil + } + return o.DayRange +} diff --git a/tests/mockserver/internal/sdk/models/components/insightsoverviewrequest.go b/tests/mockserver/internal/sdk/models/components/insightsoverviewrequest.go new file mode 100644 index 00000000..79e6d2e9 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/insightsoverviewrequest.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type InsightsOverviewRequest struct { + // Departments for which Insights are requested. + Departments []string `json:"departments,omitempty"` + DayRange *Period `json:"dayRange,omitempty"` +} + +func (o *InsightsOverviewRequest) GetDepartments() []string { + if o == nil { + return nil + } + return o.Departments +} + +func (o *InsightsOverviewRequest) GetDayRange() *Period { + if o == nil { + return nil + } + return o.DayRange +} diff --git a/tests/mockserver/internal/sdk/models/components/insightsrequest.go b/tests/mockserver/internal/sdk/models/components/insightsrequest.go index 0cd7481b..4129c48e 100644 --- a/tests/mockserver/internal/sdk/models/components/insightsrequest.go +++ b/tests/mockserver/internal/sdk/models/components/insightsrequest.go @@ -10,17 +10,20 @@ import ( type InsightsRequestCategory string const ( - InsightsRequestCategoryAgents InsightsRequestCategory = "AGENTS" - InsightsRequestCategoryAi InsightsRequestCategory = "AI" - InsightsRequestCategoryAiApps InsightsRequestCategory = "AI_APPS" - InsightsRequestCategoryAnnouncements InsightsRequestCategory = "ANNOUNCEMENTS" - InsightsRequestCategoryAnswers InsightsRequestCategory = "ANSWERS" - InsightsRequestCategoryCollections InsightsRequestCategory = "COLLECTIONS" - InsightsRequestCategoryContent InsightsRequestCategory = "CONTENT" - InsightsRequestCategoryGleanAssist InsightsRequestCategory = "GLEAN_ASSIST" - InsightsRequestCategoryQueries InsightsRequestCategory = "QUERIES" - InsightsRequestCategoryShortcuts InsightsRequestCategory = "SHORTCUTS" - InsightsRequestCategoryUsers InsightsRequestCategory = "USERS" + InsightsRequestCategoryAgents InsightsRequestCategory = "AGENTS" + InsightsRequestCategoryAgentUsers InsightsRequestCategory = "AGENT_USERS" + InsightsRequestCategoryTopAgents InsightsRequestCategory = "TOP_AGENTS" + InsightsRequestCategoryAgentsUsageByDepartment InsightsRequestCategory = "AGENTS_USAGE_BY_DEPARTMENT" + InsightsRequestCategoryAi InsightsRequestCategory = "AI" + InsightsRequestCategoryAiApps InsightsRequestCategory = "AI_APPS" + InsightsRequestCategoryAnnouncements InsightsRequestCategory = "ANNOUNCEMENTS" + InsightsRequestCategoryAnswers InsightsRequestCategory = "ANSWERS" + InsightsRequestCategoryCollections InsightsRequestCategory = "COLLECTIONS" + InsightsRequestCategoryContent InsightsRequestCategory = "CONTENT" + InsightsRequestCategoryGleanAssist InsightsRequestCategory = "GLEAN_ASSIST" + InsightsRequestCategoryQueries InsightsRequestCategory = "QUERIES" + InsightsRequestCategoryShortcuts InsightsRequestCategory = "SHORTCUTS" + InsightsRequestCategoryUsers InsightsRequestCategory = "USERS" ) func (e InsightsRequestCategory) ToPointer() *InsightsRequestCategory { @@ -34,6 +37,12 @@ func (e *InsightsRequestCategory) UnmarshalJSON(data []byte) error { switch v { case "AGENTS": fallthrough + case "AGENT_USERS": + fallthrough + case "TOP_AGENTS": + fallthrough + case "AGENTS_USAGE_BY_DEPARTMENT": + fallthrough case "AI": fallthrough case "AI_APPS": @@ -93,22 +102,59 @@ func (e *AssistantActivityType) UnmarshalJSON(data []byte) error { } type InsightsRequest struct { + OverviewRequest *InsightsOverviewRequest `json:"overviewRequest,omitempty"` + AssistantRequest *InsightsAssistantRequest `json:"assistantRequest,omitempty"` + AgentsRequest *AgentsInsightsV2Request `json:"agentsRequest,omitempty"` + // If true, suppresses the generation of per-user Insights in the response. Default is false. + DisablePerUserInsights *bool `json:"disablePerUserInsights,omitempty"` // Categories of data requested. Request can include single or multiple types. - Categories []InsightsRequestCategory `json:"categories"` + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + Categories []InsightsRequestCategory `json:"categories,omitempty"` // Departments that the data is requested for. If this is empty, corresponds to whole company. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. Departments []string `json:"departments,omitempty"` DayRange *Period `json:"dayRange,omitempty"` AiAppRequestOptions *InsightsAiAppRequestOptions `json:"aiAppRequestOptions,omitempty"` AgentsRequestOptions *InsightsAgentsRequestOptions `json:"agentsRequestOptions,omitempty"` // Types of activity that should count in the definition of an Assistant Active User. Affects only insights for AI category. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. AssistantActivityTypes []AssistantActivityType `json:"assistantActivityTypes,omitempty"` - // If true, suppresses the generation of per-user Insights in the response. Default is false. - DisablePerUserInsights *bool `json:"disablePerUserInsights,omitempty"` +} + +func (o *InsightsRequest) GetOverviewRequest() *InsightsOverviewRequest { + if o == nil { + return nil + } + return o.OverviewRequest +} + +func (o *InsightsRequest) GetAssistantRequest() *InsightsAssistantRequest { + if o == nil { + return nil + } + return o.AssistantRequest +} + +func (o *InsightsRequest) GetAgentsRequest() *AgentsInsightsV2Request { + if o == nil { + return nil + } + return o.AgentsRequest +} + +func (o *InsightsRequest) GetDisablePerUserInsights() *bool { + if o == nil { + return nil + } + return o.DisablePerUserInsights } func (o *InsightsRequest) GetCategories() []InsightsRequestCategory { if o == nil { - return []InsightsRequestCategory{} + return nil } return o.Categories } @@ -147,10 +193,3 @@ func (o *InsightsRequest) GetAssistantActivityTypes() []AssistantActivityType { } return o.AssistantActivityTypes } - -func (o *InsightsRequest) GetDisablePerUserInsights() *bool { - if o == nil { - return nil - } - return o.DisablePerUserInsights -} From 64b3b70ea197b68e0a33eb80c3b252f8c4e5888b Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 20:00:38 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow