diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 91cf2fed..c32ecef8 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,26 +1,26 @@ lockVersion: 2.0.0 id: 3e3290ca-0ee8-4981-b1bc-14536048fa63 management: - docChecksum: 9f934db728af8f9aaaa1df7eb9781bff + docChecksum: aee950fecf1c657983edfc4e58e7b866 docVersion: 0.9.0 - speakeasyVersion: 1.706.1 - generationVersion: 2.809.2 - releaseVersion: 0.12.1 - configChecksum: 445d4c451e5ec0817b996f7782217353 + speakeasyVersion: 1.708.0 + generationVersion: 2.811.2 + releaseVersion: 0.12.2 + configChecksum: abe193f4f2a2796c5686ddf95338ac1e repoURL: https://github.com/gleanwork/api-client-python.git installationURL: https://github.com/gleanwork/api-client-python.git published: true persistentEdits: - generation_id: 570b69de-0a85-488e-8d00-41c4dc3591c8 - pristine_commit_hash: f9fa6f4a12ab8af9007b75d6c64504c5b7e710d8 - pristine_tree_hash: b8fa5b8be2db0ea4757e7500875fea78a4b61b80 + generation_id: c9318d9f-dc47-48aa-b7d4-cd62a9fc6cc2 + pristine_commit_hash: 9ed5b0473e198394f740d8fd5bc438b6f9bc9f91 + pristine_tree_hash: bcad196dc5edb7d2846ec11818628eaf3c1701d3 features: python: additionalDependencies: 1.0.0 additionalProperties: 1.0.1 configurableModuleName: 0.2.0 constsAndDefaults: 1.0.6 - core: 6.0.3 + core: 6.0.4 defaultEnabledRetries: 0.2.0 deprecations: 3.0.2 devContainers: 3.0.0 @@ -155,12 +155,12 @@ trackedFiles: pristine_git_object: aec0cc1eec7dad413ec698c535c010e6be756a69 docs/models/agentrun.md: id: 71e2caf9b95a - last_write_checksum: sha1:e78aeb4eff73bf8d90878933b0325e72ed43e72a - pristine_git_object: ba0e0f9a25efd7f050da4c76e9bc2c2db66593ea + last_write_checksum: sha1:8433dcf487a90f703f04b766383a08b5c0c933b3 + pristine_git_object: 534e93714734fd41fabc0d64b5da344b2dda110d docs/models/agentruncreate.md: id: 2ab11e93c9de - last_write_checksum: sha1:0bb40ce69125ac4d6240e600001c0ed360a981a8 - pristine_git_object: 8c52882a75a63a52fcf9ac9d2db0e124ec10bef9 + last_write_checksum: sha1:5f6d67b0cf39049f4ead7eecec6a27f3d2862cba + pristine_git_object: 46d31de6280f25734883618e5ac037cb623e6eda docs/models/agentrunwaitresponse.md: id: 2c571dee53ea last_write_checksum: sha1:a9d9e9928a5629f4c75364315f312801f06c51b7 @@ -2595,8 +2595,8 @@ trackedFiles: pristine_git_object: 61dd41f0319201cc105e29174ab1cc0018cecbce docs/sdks/agents/README.md: id: 5965d8232fd8 - last_write_checksum: sha1:3c2847fb0fe040b14096cfd686aca2a59c7b830f - pristine_git_object: cf7b08733e52531179777a0c85f1e95365741502 + last_write_checksum: sha1:ac437d9707a34794688d275ba9b9daad024f0410 + pristine_git_object: bf4a2db8f086430f20eb25bf3cc7652b3a4bcef6 docs/sdks/announcements/README.md: id: 3d2e130a217c last_write_checksum: sha1:ecfa655bb27dee6890656542cfafda0aa6ed1ab9 @@ -2615,8 +2615,8 @@ trackedFiles: pristine_git_object: b9a4856d52e9c48fb4917c0052bf86be2ad9cd0e docs/sdks/clientchat/README.md: id: baf998e3d238 - last_write_checksum: sha1:a80438d3ef8f0fff87e0e39956030f05d3bc8a2c - pristine_git_object: c3c363b487f49d552c6e5322bbe243603ff2c993 + last_write_checksum: sha1:0c7abf8ce4c4d4767f38f24eea295e728ed9a254 + pristine_git_object: 07bed0f457fb3b70139c553172ef54becca7fdcb docs/sdks/clientdocuments/README.md: id: e0c074acef4e last_write_checksum: sha1:ef34fa1517c866b9ae0fdb50847031421f26ea0b @@ -2715,8 +2715,8 @@ trackedFiles: pristine_git_object: 33c17ec92e441b6c363a28a5b7319df5a2ad94dd pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:e9db932bb828d9c1245edec14224a5690a80b7a3 - pristine_git_object: 2a56a22494af43f01d8902bd6a0f498dd23f305f + last_write_checksum: sha1:7dc5cd0785a78e264621f6d62588527e5a09f7ca + pristine_git_object: 090c699ac2a8aa2d284ada6cbb1118b82a03d6c3 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:c2c83f71dea61eb50c9e05da83b16d18b4da8794 @@ -2743,12 +2743,12 @@ trackedFiles: pristine_git_object: 58c4d70ac1797b86ff5c4237cafbc344c42d8f64 src/glean/api_client/_version.py: id: 0ce22b26136b - last_write_checksum: sha1:a666730776e1ff328b50bac5dcffef7f4c9045a2 - pristine_git_object: e2b72bf755902fbb0842635724ecb14ab9cca446 + last_write_checksum: sha1:338def8b7d9f4275dea092a43013e6f33dc201df + pristine_git_object: 93b0bbc77a52bc1e9466738aeedb908a1ce01196 src/glean/api_client/agents.py: id: b925701a9217 - last_write_checksum: sha1:35034b44db8e95826ceb314f3a59eeb8961fd419 - pristine_git_object: 1ada812a83100cb15fa6ff745090f76f1e58250f + last_write_checksum: sha1:c1688c3d141db7707458f3ac7ff29c4a71e6812b + pristine_git_object: e83595d0b12f20855f2e75dae207c28168c0f25c src/glean/api_client/announcements.py: id: 452f3d593912 last_write_checksum: sha1:f46bdf97d06f038b579907fdb879a65bc995d326 @@ -2939,12 +2939,12 @@ trackedFiles: pristine_git_object: fa71fb35d11dede8cb81dbfc83f7ec2fa2ea52d0 src/glean/api_client/models/agentrun.py: id: b808ffdaa4d9 - last_write_checksum: sha1:4e9d703fc46bddfe9a2a571412242efd59b97390 - pristine_git_object: 69d2ea1886f5113e2fdf5c05b334ea32bd9e9c5e + last_write_checksum: sha1:69120d4a77c7f4670973a7e41af55b4ea2af1f8b + pristine_git_object: 4c519b560d3fffcab870f148df81060487beb16f src/glean/api_client/models/agentruncreate.py: id: e987c7a76285 - last_write_checksum: sha1:c14079d3e754e811bd80b76ebd071c918f88f91c - pristine_git_object: df2aa824479c52f2f263f4b88a004a0125eccc75 + last_write_checksum: sha1:d02fda45ed106de951c65f67dbc23110223e66ee + pristine_git_object: 496807b00439dc1486393dd942b21194707d2887 src/glean/api_client/models/agentrunwaitresponse.py: id: 063b87daf535 last_write_checksum: sha1:a8afa7c0621527c4b83cc59ac61b6a0973f86181 @@ -5098,7 +5098,7 @@ trackedFiles: tests/mockserver/internal/handler/pathpostrestapiv1createauthtoken.go: last_write_checksum: sha1:6ce83ba03066acb436796c018d19715615f548c1 tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go: - last_write_checksum: sha1:14b4a1d98dd55ce2b487ae1aaab4a7dece08df25 + last_write_checksum: sha1:f9f4c718408bddadbdf826194f07970bb111e57e tests/mockserver/internal/handler/pathpostrestapiv1createshortcut.go: last_write_checksum: sha1:dcdf684a85e20db1aee571db9a54a3ee259d71d5 tests/mockserver/internal/handler/pathpostrestapiv1deleteallchats.go: @@ -5226,9 +5226,9 @@ trackedFiles: tests/mockserver/internal/sdk/models/components/agentexecutionstatus.go: last_write_checksum: sha1:ef904e3fd25fd902d355e88115d0721dfecab4f8 tests/mockserver/internal/sdk/models/components/agentrun.go: - last_write_checksum: sha1:87a03588cdf4095a565a7e1bcb47f5772bb66588 + last_write_checksum: sha1:a69cc58ceadc947b1e9dd587f9d936ef9aa266eb tests/mockserver/internal/sdk/models/components/agentruncreate.go: - last_write_checksum: sha1:ef0c3d64cb27df6aec71357de2952a2f5ad373f2 + last_write_checksum: sha1:b6d18d560f9137f1603b59692f73da586eaed80d tests/mockserver/internal/sdk/models/components/agentrunwaitresponse.go: last_write_checksum: sha1:75b0a516ab1c183abeeb9e27abc8a00f265f32ad tests/mockserver/internal/sdk/models/components/agentschemas.go: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index ea00bcf5..43449862 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -33,7 +33,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: true python: - version: 0.12.1 + version: 0.12.2 additionalDependencies: dev: {} main: {} @@ -57,6 +57,7 @@ python: flattenGlobalSecurity: true flattenRequests: true flatteningOrder: parameters-first + forwardCompatibleEnumsByDefault: false imports: option: openapi paths: diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index 4e1c4154..02e7e5fa 100644 --- a/.speakeasy/glean-merged-spec.yaml +++ b/.speakeasy/glean-merged-spec.yaml @@ -2,7 +2,7 @@ openapi: 3.0.0 info: version: 0.9.0 title: Glean API - x-source-commit-sha: 9e30d574b26af5aea9f343b173a4c04a4d6bd044 + x-source-commit-sha: 2a745f932cc47169f6ceb0e7b3e9869d02726cea description: | # Introduction In addition to the data sources that Glean has built-in support for, Glean also provides a REST API that enables customers to put arbitrary content in the search index. This is useful, for example, for doing permissions-aware search over content in internal tools that reside on-prem as well as for searching over applications that Glean does not currently support first class. In addition these APIs allow the customer to push organization data (people info, organization structure etc) into Glean. @@ -22,7 +22,7 @@ info: These API clients provide type-safe, idiomatic interfaces for working with Glean IndexingAPIs in your language of choice. x-logo: url: https://app.glean.com/images/glean-text2.svg - x-open-api-commit-sha: e9deba03749240dbb9c0ba9d110e15591825b6ab + x-open-api-commit-sha: c9207631abff9271cdd02433399797f6ee15e063 x-speakeasy-name: 'Glean API' servers: - url: https://{instance}-be.glean.com @@ -915,7 +915,7 @@ paths: tags: - Agents summary: Create an agent run and stream the response - description: Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the result as a stream of server-sent events (SSE). + description: "Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the result as a stream of server-sent events (SSE). **Note**: If the agent uses an input form trigger, all form fields (including optional fields) must be included in the `input` object." operationId: createAndStreamRun x-visibility: Preview requestBody: @@ -979,7 +979,7 @@ paths: tags: - Agents summary: Create an agent run and wait for the response - description: Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the final response. + description: "Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the final response. **Note**: If the agent uses an input form trigger, all form fields (including optional fields) must be included in the `input` object." operationId: createAndWaitRun x-visibility: Preview requestBody: @@ -8039,7 +8039,7 @@ components: - type title: MessageTextBlock AgentRunCreate: - description: Payload for creating a run. + description: "Payload for creating a run. **Important**: If the agent uses an input form trigger, the `input` field is required and must include all fields defined in the form schema. Even fields marked as optional in the UI must be included in the request—use an empty string (`\"\"`) for optional fields without values. Omitting required form fields will result in a 500 error." type: object required: - agent_id @@ -8051,7 +8051,7 @@ components: input: type: object title: Input - description: The input to the agent. + description: The input to the agent. Required when the agent uses an input form trigger. additionalProperties: true messages: type: array diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index f7821695..45775151 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,12 +1,12 @@ -speakeasyVersion: 1.706.1 +speakeasyVersion: 1.708.0 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:047cdb5efd8f47a217d3958b57af6078f3c4d4f1ba43862f16e7760f1f16ae6d - sourceBlobDigest: sha256:ac6385a48d08a34b59f5cb164fa7200e328754ed3260692a0c0d044a7499c7db + sourceRevisionDigest: sha256:a46c82fb26193f4747e1b7eca5ddf4cd77edbb57c9828a17c45e2b1f5fc02f4e + sourceBlobDigest: sha256:ba6a37b98073179a44805ba67125e23e907ddc0a6ca4c409ff48c53c399495d2 tags: - latest - - speakeasy-sdk-regen-1770336010 + - speakeasy-sdk-regen-1770409581 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:047cdb5efd8f47a217d3958b57af6078f3c4d4f1ba43862f16e7760f1f16ae6d - sourceBlobDigest: sha256:ac6385a48d08a34b59f5cb164fa7200e328754ed3260692a0c0d044a7499c7db + sourceRevisionDigest: sha256:a46c82fb26193f4747e1b7eca5ddf4cd77edbb57c9828a17c45e2b1f5fc02f4e + sourceBlobDigest: sha256:ba6a37b98073179a44805ba67125e23e907ddc0a6ca4c409ff48c53c399495d2 codeSamplesNamespace: glean-api-specs-python-code-samples - codeSamplesRevisionDigest: sha256:b30002ad3742a0457ea1d3e7826c76600292705f16984c137abf8e8691ff1528 + codeSamplesRevisionDigest: sha256:714a88487636e1f68c9866e8ea394f8bac5439f5d461c0f13d24f4d054c8a7c3 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/RELEASES.md b/RELEASES.md index 2b3f2fb3..cd25ea66 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -518,4 +518,14 @@ Based on: ### Generated - [python v0.12.1] . ### Releases -- [PyPI v0.12.1] https://pypi.org/project/glean-api-client/0.12.1 - . \ No newline at end of file +- [PyPI v0.12.1] https://pypi.org/project/glean-api-client/0.12.1 - . + +## 2026-02-06 20:25:52 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.708.0 (2.811.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.12.2] . +### Releases +- [PyPI v0.12.2] https://pypi.org/project/glean-api-client/0.12.2 - . \ No newline at end of file diff --git a/docs/models/agentrun.md b/docs/models/agentrun.md index ba0e0f9a..534e9371 100644 --- a/docs/models/agentrun.md +++ b/docs/models/agentrun.md @@ -1,14 +1,14 @@ # AgentRun -Payload for creating a run. +Payload for creating a run. **Important**: If the agent uses an input form trigger, the `input` field is required and must include all fields defined in the form schema. Even fields marked as optional in the UI must be included in the request—use an empty string (`""`) for optional fields without values. Omitting required form fields will result in a 500 error. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to run. | -| `input` | Dict[str, *Any*] | :heavy_minus_sign: | The input to the agent. | -| `messages` | List[[models.Message](../models/message.md)] | :heavy_minus_sign: | The messages to pass an input to the agent. | -| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | The metadata to pass to the agent. | -| `status` | [Optional[models.AgentExecutionStatus]](../models/agentexecutionstatus.md) | :heavy_minus_sign: | The status of the run. One of 'error', 'success'. | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to run. | +| `input` | Dict[str, *Any*] | :heavy_minus_sign: | The input to the agent. Required when the agent uses an input form trigger. | +| `messages` | List[[models.Message](../models/message.md)] | :heavy_minus_sign: | The messages to pass an input to the agent. | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | The metadata to pass to the agent. | +| `status` | [Optional[models.AgentExecutionStatus]](../models/agentexecutionstatus.md) | :heavy_minus_sign: | The status of the run. One of 'error', 'success'. | \ No newline at end of file diff --git a/docs/models/agentruncreate.md b/docs/models/agentruncreate.md index 8c52882a..46d31de6 100644 --- a/docs/models/agentruncreate.md +++ b/docs/models/agentruncreate.md @@ -1,13 +1,13 @@ # AgentRunCreate -Payload for creating a run. +Payload for creating a run. **Important**: If the agent uses an input form trigger, the `input` field is required and must include all fields defined in the form schema. Even fields marked as optional in the UI must be included in the request—use an empty string (`""`) for optional fields without values. Omitting required form fields will result in a 500 error. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to run. | -| `input` | Dict[str, *Any*] | :heavy_minus_sign: | The input to the agent. | -| `messages` | List[[models.Message](../models/message.md)] | :heavy_minus_sign: | The messages to pass an input to the agent. | -| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | The metadata to pass to the agent. | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to run. | +| `input` | Dict[str, *Any*] | :heavy_minus_sign: | The input to the agent. Required when the agent uses an input form trigger. | +| `messages` | List[[models.Message](../models/message.md)] | :heavy_minus_sign: | The messages to pass an input to the agent. | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | The metadata to pass to the agent. | \ No newline at end of file diff --git a/docs/sdks/agents/README.md b/docs/sdks/agents/README.md index cf7b0873..bf4a2db8 100644 --- a/docs/sdks/agents/README.md +++ b/docs/sdks/agents/README.md @@ -136,7 +136,7 @@ with Glean( ## run_stream -Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the result as a stream of server-sent events (SSE). +Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the result as a stream of server-sent events (SSE). **Note**: If the agent uses an input form trigger, all form fields (including optional fields) must be included in the `input` object. ### Example Usage @@ -163,13 +163,13 @@ with Glean( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to run. | -| `input` | Dict[str, *Any*] | :heavy_minus_sign: | The input to the agent. | -| `messages` | List[[models.Message](../../models/message.md)] | :heavy_minus_sign: | The messages to pass an input to the agent. | -| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | The metadata to pass to the agent. | -| `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 | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to run. | +| `input` | Dict[str, *Any*] | :heavy_minus_sign: | The input to the agent. Required when the agent uses an input form trigger. | +| `messages` | List[[models.Message](../../models/message.md)] | :heavy_minus_sign: | The messages to pass an input to the agent. | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | The metadata to pass to the agent. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -183,7 +183,7 @@ with Glean( ## run -Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the final response. +Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the final response. **Note**: If the agent uses an input form trigger, all form fields (including optional fields) must be included in the `input` object. ### Example Usage @@ -210,13 +210,13 @@ with Glean( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to run. | -| `input` | Dict[str, *Any*] | :heavy_minus_sign: | The input to the agent. | -| `messages` | List[[models.Message](../../models/message.md)] | :heavy_minus_sign: | The messages to pass an input to the agent. | -| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | The metadata to pass to the agent. | -| `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 | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to run. | +| `input` | Dict[str, *Any*] | :heavy_minus_sign: | The input to the agent. Required when the agent uses an input form trigger. | +| `messages` | List[[models.Message](../../models/message.md)] | :heavy_minus_sign: | The messages to pass an input to the agent. | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | The metadata to pass to the agent. | +| `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/docs/sdks/clientchat/README.md b/docs/sdks/clientchat/README.md index c3c363b4..07bed0f4 100644 --- a/docs/sdks/clientchat/README.md +++ b/docs/sdks/clientchat/README.md @@ -19,9 +19,27 @@ Have a conversation with Glean AI. -### Example Usage +### Example Usage: citationResponse - + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.chat.create(messages=[], timeout_millis=30000) + + # Handle response + print(res) + +``` +### Example Usage: defaultExample + + ```python from glean.api_client import Glean, models import os @@ -44,6 +62,70 @@ with Glean( # Handle response print(res) +``` +### Example Usage: gptAgentExample + + +```python +from glean.api_client import Glean, models +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.chat.create(messages=[ + { + "fragments": [ + models.ChatMessageFragment( + text="Who was the first person to land on the moon?", + ), + ], + }, + ], agent_config={ + "agent": models.AgentEnum.GPT, + }, timeout_millis=30000) + + # Handle response + print(res) + +``` +### Example Usage: streamingExample + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.chat.create(messages=[], timeout_millis=30000) + + # Handle response + print(res) + +``` +### Example Usage: updateResponse + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.chat.create(messages=[], timeout_millis=30000) + + # Handle response + print(res) + ``` ### Parameters @@ -404,9 +486,27 @@ with Glean( Have a conversation with Glean AI. -### Example Usage +### Example Usage: citationResponse - + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.chat.create_stream(messages=[], timeout_millis=30000) + + # Handle response + print(res) + +``` +### Example Usage: defaultExample + + ```python from glean.api_client import Glean, models import os @@ -429,6 +529,70 @@ with Glean( # Handle response print(res) +``` +### Example Usage: gptAgentExample + + +```python +from glean.api_client import Glean, models +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.chat.create_stream(messages=[ + { + "fragments": [ + models.ChatMessageFragment( + text="Who was the first person to land on the moon?", + ), + ], + }, + ], agent_config={ + "agent": models.AgentEnum.GPT, + }, timeout_millis=30000) + + # Handle response + print(res) + +``` +### Example Usage: streamingExample + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.chat.create_stream(messages=[], timeout_millis=30000) + + # Handle response + print(res) + +``` +### Example Usage: updateResponse + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.client.chat.create_stream(messages=[], timeout_millis=30000) + + # Handle response + print(res) + ``` ### Parameters diff --git a/pyproject.toml b/pyproject.toml index 2a56a224..090c699a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "glean-api-client" -version = "0.12.1" +version = "0.12.2" description = "Python Client SDK Generated by Speakeasy." authors = [{ name = "Glean Technologies, Inc." },] readme = "README-PYPI.md" diff --git a/src/glean/api_client/_version.py b/src/glean/api_client/_version.py index e2b72bf7..93b0bbc7 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-api-client" -__version__: str = "0.12.1" +__version__: str = "0.12.2" __openapi_doc_version__: str = "0.9.0" -__gen_version__: str = "2.809.2" -__user_agent__: str = "speakeasy-sdk/python 0.12.1 2.809.2 0.9.0 glean-api-client" +__gen_version__: str = "2.811.2" +__user_agent__: str = "speakeasy-sdk/python 0.12.2 2.811.2 0.9.0 glean-api-client" try: if __package__ is not None: diff --git a/src/glean/api_client/agents.py b/src/glean/api_client/agents.py index 1ada812a..e83595d0 100644 --- a/src/glean/api_client/agents.py +++ b/src/glean/api_client/agents.py @@ -560,10 +560,10 @@ def run_stream( ) -> str: r"""Create an agent run and stream the response - Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the result as a stream of server-sent events (SSE). + Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the result as a stream of server-sent events (SSE). **Note**: If the agent uses an input form trigger, all form fields (including optional fields) must be included in the `input` object. :param agent_id: The ID of the agent to run. - :param input: The input to the agent. + :param input: The input to the agent. Required when the agent uses an input form trigger. :param messages: The messages to pass an input to the agent. :param metadata: The metadata to pass to the agent. :param retries: Override the default retry configuration for this method @@ -660,10 +660,10 @@ async def run_stream_async( ) -> str: r"""Create an agent run and stream the response - Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the result as a stream of server-sent events (SSE). + Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the result as a stream of server-sent events (SSE). **Note**: If the agent uses an input form trigger, all form fields (including optional fields) must be included in the `input` object. :param agent_id: The ID of the agent to run. - :param input: The input to the agent. + :param input: The input to the agent. Required when the agent uses an input form trigger. :param messages: The messages to pass an input to the agent. :param metadata: The metadata to pass to the agent. :param retries: Override the default retry configuration for this method @@ -760,10 +760,10 @@ def run( ) -> models.AgentRunWaitResponse: r"""Create an agent run and wait for the response - Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the final response. + Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the final response. **Note**: If the agent uses an input form trigger, all form fields (including optional fields) must be included in the `input` object. :param agent_id: The ID of the agent to run. - :param input: The input to the agent. + :param input: The input to the agent. Required when the agent uses an input form trigger. :param messages: The messages to pass an input to the agent. :param metadata: The metadata to pass to the agent. :param retries: Override the default retry configuration for this method @@ -860,10 +860,10 @@ async def run_async( ) -> models.AgentRunWaitResponse: r"""Create an agent run and wait for the response - Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the final response. + Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the final response. **Note**: If the agent uses an input form trigger, all form fields (including optional fields) must be included in the `input` object. :param agent_id: The ID of the agent to run. - :param input: The input to the agent. + :param input: The input to the agent. Required when the agent uses an input form trigger. :param messages: The messages to pass an input to the agent. :param metadata: The metadata to pass to the agent. :param retries: Override the default retry configuration for this method diff --git a/src/glean/api_client/models/agentrun.py b/src/glean/api_client/models/agentrun.py index 69d2ea18..4c519b56 100644 --- a/src/glean/api_client/models/agentrun.py +++ b/src/glean/api_client/models/agentrun.py @@ -10,12 +10,12 @@ class AgentRunTypedDict(TypedDict): - r"""Payload for creating a run.""" + r"""Payload for creating a run. **Important**: If the agent uses an input form trigger, the `input` field is required and must include all fields defined in the form schema. Even fields marked as optional in the UI must be included in the request—use an empty string (`\"\"`) for optional fields without values. Omitting required form fields will result in a 500 error.""" agent_id: str r"""The ID of the agent to run.""" input: NotRequired[Dict[str, Any]] - r"""The input to the agent.""" + r"""The input to the agent. Required when the agent uses an input form trigger.""" messages: NotRequired[List[MessageTypedDict]] r"""The messages to pass an input to the agent.""" metadata: NotRequired[Dict[str, Any]] @@ -25,13 +25,13 @@ class AgentRunTypedDict(TypedDict): class AgentRun(BaseModel): - r"""Payload for creating a run.""" + r"""Payload for creating a run. **Important**: If the agent uses an input form trigger, the `input` field is required and must include all fields defined in the form schema. Even fields marked as optional in the UI must be included in the request—use an empty string (`\"\"`) for optional fields without values. Omitting required form fields will result in a 500 error.""" agent_id: str r"""The ID of the agent to run.""" input: Optional[Dict[str, Any]] = None - r"""The input to the agent.""" + r"""The input to the agent. Required when the agent uses an input form trigger.""" messages: Optional[List[Message]] = None r"""The messages to pass an input to the agent.""" diff --git a/src/glean/api_client/models/agentruncreate.py b/src/glean/api_client/models/agentruncreate.py index df2aa824..496807b0 100644 --- a/src/glean/api_client/models/agentruncreate.py +++ b/src/glean/api_client/models/agentruncreate.py @@ -9,12 +9,12 @@ class AgentRunCreateTypedDict(TypedDict): - r"""Payload for creating a run.""" + r"""Payload for creating a run. **Important**: If the agent uses an input form trigger, the `input` field is required and must include all fields defined in the form schema. Even fields marked as optional in the UI must be included in the request—use an empty string (`\"\"`) for optional fields without values. Omitting required form fields will result in a 500 error.""" agent_id: str r"""The ID of the agent to run.""" input: NotRequired[Dict[str, Any]] - r"""The input to the agent.""" + r"""The input to the agent. Required when the agent uses an input form trigger.""" messages: NotRequired[List[MessageTypedDict]] r"""The messages to pass an input to the agent.""" metadata: NotRequired[Dict[str, Any]] @@ -22,13 +22,13 @@ class AgentRunCreateTypedDict(TypedDict): class AgentRunCreate(BaseModel): - r"""Payload for creating a run.""" + r"""Payload for creating a run. **Important**: If the agent uses an input form trigger, the `input` field is required and must include all fields defined in the form schema. Even fields marked as optional in the UI must be included in the request—use an empty string (`\"\"`) for optional fields without values. Omitting required form fields will result in a 500 error.""" agent_id: str r"""The ID of the agent to run.""" input: Optional[Dict[str, Any]] = None - r"""The input to the agent.""" + r"""The input to the agent. Required when the agent uses an input form trigger.""" messages: Optional[List[Message]] = None r"""The messages to pass an input to the agent.""" diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go b/tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go index 371b9023..5c99a0ad 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go @@ -56,14 +56,14 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ operations.ResponseBody2{ Collection: &components.Collection{ Name: "", - Description: "whole busily jive hawk gee basic minus hence", + Description: "motionless whenever paintwork import over cuckoo", AddedRoles: []components.UserRoleSpecification{ components.UserRoleSpecification{ Person: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", }, - Role: components.UserRoleAnswerModerator, + Role: components.UserRoleOwner, }, }, RemovedRoles: []components.UserRoleSpecification{ @@ -90,7 +90,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ID: 158969, + ID: 363711, Creator: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -101,7 +101,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, Items: []components.CollectionItem{ components.CollectionItem{ - CollectionID: 110375, + CollectionID: 570197, CreatedBy: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -266,13 +266,13 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ Name: "George Clooney", ObfuscatedID: "abc123", }, - Role: components.UserRoleEditor, + Role: components.UserRoleAnswerModerator, }, }, }, Collection: &components.Collection{ Name: "", - Description: "wedge colorfully orientate rally", + Description: "athwart skateboard newsstand farm bourgeoisie ah how elliptical aha well-to-do", AudienceFilters: []components.FacetFilter{ components.FacetFilter{ FieldName: types.String("type"), @@ -288,7 +288,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ID: 131797, + ID: 643990, Creator: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -300,7 +300,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ Children: []components.Collection{ components.Collection{ Name: "", - Description: "outside yippee sidetrack mature regularly mouser inject worth", + Description: "woot purse salty even as advanced", AudienceFilters: []components.FacetFilter{ components.FacetFilter{ FieldName: types.String("type"), @@ -316,7 +316,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ID: 149448, + ID: 359978, Creator: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -328,7 +328,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ItemType: components.CollectionItemItemTypeCollection, + ItemType: components.CollectionItemItemTypeURL, }, }, }, diff --git a/tests/mockserver/internal/sdk/models/components/agentrun.go b/tests/mockserver/internal/sdk/models/components/agentrun.go index 23ab5120..dcff6d12 100644 --- a/tests/mockserver/internal/sdk/models/components/agentrun.go +++ b/tests/mockserver/internal/sdk/models/components/agentrun.go @@ -2,11 +2,11 @@ package components -// AgentRun - Payload for creating a run. +// AgentRun - Payload for creating a run. **Important**: If the agent uses an input form trigger, the `input` field is required and must include all fields defined in the form schema. Even fields marked as optional in the UI must be included in the request—use an empty string (`""`) for optional fields without values. Omitting required form fields will result in a 500 error. type AgentRun struct { // The ID of the agent to run. AgentID string `json:"agent_id"` - // The input to the agent. + // The input to the agent. Required when the agent uses an input form trigger. Input map[string]any `json:"input,omitempty"` // The messages to pass an input to the agent. Messages []Message `json:"messages,omitempty"` diff --git a/tests/mockserver/internal/sdk/models/components/agentruncreate.go b/tests/mockserver/internal/sdk/models/components/agentruncreate.go index c095a382..e0f2b034 100644 --- a/tests/mockserver/internal/sdk/models/components/agentruncreate.go +++ b/tests/mockserver/internal/sdk/models/components/agentruncreate.go @@ -2,11 +2,11 @@ package components -// AgentRunCreate - Payload for creating a run. +// AgentRunCreate - Payload for creating a run. **Important**: If the agent uses an input form trigger, the `input` field is required and must include all fields defined in the form schema. Even fields marked as optional in the UI must be included in the request—use an empty string (`""`) for optional fields without values. Omitting required form fields will result in a 500 error. type AgentRunCreate struct { // The ID of the agent to run. AgentID string `json:"agent_id"` - // The input to the agent. + // The input to the agent. Required when the agent uses an input form trigger. Input map[string]any `json:"input,omitempty"` // The messages to pass an input to the agent. Messages []Message `json:"messages,omitempty"`