/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: c56babc22a20 */ import { clientChatCreate } from "../funcs/clientChatCreate.js"; import { clientChatCreateStream } from "../funcs/clientChatCreateStream.js"; import { clientChatDelete } from "../funcs/clientChatDelete.js"; import { clientChatDeleteAll } from "../funcs/clientChatDeleteAll.js"; import { clientChatDeleteFiles } from "../funcs/clientChatDeleteFiles.js"; import { clientChatList } from "../funcs/clientChatList.js"; import { clientChatRetrieve } from "../funcs/clientChatRetrieve.js"; import { clientChatRetrieveApplication } from "../funcs/clientChatRetrieveApplication.js"; import { clientChatRetrieveFiles } from "../funcs/clientChatRetrieveFiles.js"; import { clientChatUploadFiles } from "../funcs/clientChatUploadFiles.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Chat extends ClientSDK { /** * Chat * * @remarks * Have a conversation with Glean AI. */ async create( chatRequest: components.ChatRequest, locale?: string | undefined, timezoneOffset?: number | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientChatCreate( this, chatRequest, locale, timezoneOffset, options, )); } /** * Deletes all saved Chats owned by a user * * @remarks * Deletes all saved Chats a user has had and all their contained conversational content. */ async deleteAll( locale?: string | undefined, timezoneOffset?: number | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientChatDeleteAll( this, locale, timezoneOffset, options, )); } /** * Deletes saved Chats * * @remarks * Deletes saved Chats and all their contained conversational content. */ async delete( deleteChatsRequest: components.DeleteChatsRequest, locale?: string | undefined, timezoneOffset?: number | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientChatDelete( this, deleteChatsRequest, locale, timezoneOffset, options, )); } /** * Retrieves a Chat * * @remarks * Retrieves the chat history between Glean Assistant and the user for a given Chat. */ async retrieve( getChatRequest: components.GetChatRequest, locale?: string | undefined, timezoneOffset?: number | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientChatRetrieve( this, getChatRequest, locale, timezoneOffset, options, )); } /** * Retrieves all saved Chats * * @remarks * Retrieves all the saved Chats between Glean Assistant and the user. The returned Chats contain only metadata and no conversational content. */ async list( locale?: string | undefined, timezoneOffset?: number | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientChatList( this, locale, timezoneOffset, options, )); } /** * Gets the metadata for a custom Chat application * * @remarks * Gets the Chat application details for the specified application ID. */ async retrieveApplication( getChatApplicationRequest: components.GetChatApplicationRequest, locale?: string | undefined, timezoneOffset?: number | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientChatRetrieveApplication( this, getChatApplicationRequest, locale, timezoneOffset, options, )); } /** * Upload files for Chat * * @remarks * Upload files for Chat. */ async uploadFiles( uploadChatFilesRequest: components.UploadChatFilesRequest, locale?: string | undefined, timezoneOffset?: number | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientChatUploadFiles( this, uploadChatFilesRequest, locale, timezoneOffset, options, )); } /** * Get files uploaded by a user for Chat * * @remarks * Get files uploaded by a user for Chat. */ async retrieveFiles( getChatFilesRequest: components.GetChatFilesRequest, locale?: string | undefined, timezoneOffset?: number | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientChatRetrieveFiles( this, getChatFilesRequest, locale, timezoneOffset, options, )); } /** * Delete files uploaded by a user for chat * * @remarks * Delete files uploaded by a user for Chat. */ async deleteFiles( deleteChatFilesRequest: components.DeleteChatFilesRequest, locale?: string | undefined, timezoneOffset?: number | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientChatDeleteFiles( this, deleteChatFilesRequest, locale, timezoneOffset, options, )); } /** * Chat * * @remarks * Have a conversation with Glean AI. */ async createStream( chatRequest: components.ChatRequest, timezoneOffset?: number | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientChatCreateStream( this, chatRequest, timezoneOffset, options, )); } }