@amigo-ai/sdk 0.50.0 → 0.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -685,7 +685,7 @@ var UserResource = class {
685
685
  }
686
686
  async createUser(body, headers) {
687
687
  return extractData(
688
- this.c.POST("/v1/{organization}/user/invite", {
688
+ this.c.POST("/v1/{organization}/user/", {
689
689
  params: { path: { organization: this.orgId } },
690
690
  body,
691
691
  headers
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/core/errors.ts", "../src/core/utils.ts", "../src/core/openapi-client.ts", "../src/core/auth.ts", "../src/core/retry.ts", "../src/resources/organization.ts", "../src/resources/conversation.ts", "../src/resources/services.ts", "../src/resources/user.ts", "../src/index.ts"],
4
- "sourcesContent": ["import type { Middleware } from 'openapi-fetch'\nimport { isNetworkError, parseResponseBody } from './utils'\n\n/**\n * Base error class for all Amigo SDK errors.\n * Provides common functionality and error identification.\n */\nexport class AmigoError extends Error {\n /**\n * Unique error code for programmatic error handling\n */\n readonly errorCode?: string\n\n /**\n * HTTP status code if applicable\n */\n readonly statusCode?: number\n\n /**\n * Additional context data\n */\n context?: Record<string, unknown>\n\n constructor(message: string, options?: Record<string, unknown>) {\n super(message)\n this.name = this.constructor.name\n\n // Ensure proper prototype chain for instanceof checks\n Object.setPrototypeOf(this, new.target.prototype)\n\n // Capture stack trace\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor)\n }\n\n // copies status, code, etc.\n Object.assign(this, options)\n }\n\n /**\n * Returns a JSON-serializable representation of the error\n */\n toJSON(): Record<string, unknown> {\n return {\n name: this.name,\n message: this.message,\n code: this.errorCode,\n statusCode: this.statusCode,\n context: this.context,\n stack: this.stack,\n }\n }\n}\n\n/* 4xx client errors */\nexport class BadRequestError extends AmigoError {}\nexport class AuthenticationError extends AmigoError {}\nexport class PermissionError extends AmigoError {}\nexport class NotFoundError extends AmigoError {}\nexport class ConflictError extends AmigoError {}\nexport class RateLimitError extends AmigoError {}\n\n/* 5xx server errors */\nexport class ServerError extends AmigoError {}\nexport class ServiceUnavailableError extends ServerError {}\n\n/* Internal SDK errors */\nexport class ConfigurationError extends AmigoError {\n constructor(\n message: string,\n public field?: string\n ) {\n super(message)\n this.context = { field }\n }\n}\n\n/* Validation errors */\nexport class ValidationError extends BadRequestError {\n constructor(\n msg: string,\n public fieldErrors?: Record<string, string>\n ) {\n super(msg)\n }\n}\n\n/* Network-related errors */\nexport class NetworkError extends AmigoError {\n constructor(\n message: string,\n public readonly originalError?: Error,\n public readonly request?: {\n url?: string\n method?: string\n }\n ) {\n super(message, { cause: originalError })\n this.context = { request }\n }\n}\n\n/* Parsing errors */\nexport class ParseError extends AmigoError {\n constructor(\n message: string,\n public readonly parseType: 'json' | 'response' | 'other',\n public readonly originalError?: Error\n ) {\n super(message, { cause: originalError })\n this.context = { parseType }\n }\n}\n\n/* Type guard functions */\nexport function isAmigoError(error: unknown): error is AmigoError {\n return error instanceof AmigoError\n}\n\n/* Error factory to create appropriate error instances from API responses */\nexport function createApiError(response: Response, body?: unknown): AmigoError {\n const map: Record<number, typeof AmigoError> = {\n 400: BadRequestError,\n 401: AuthenticationError,\n 403: PermissionError,\n 404: NotFoundError,\n 409: ConflictError,\n 422: ValidationError,\n 429: RateLimitError,\n 500: ServerError,\n 503: ServiceUnavailableError,\n }\n\n const errorMessageKeys = ['message', 'error', 'detail']\n\n const ErrorClass = map[response.status] ?? AmigoError\n let message = `HTTP ${response.status} ${response.statusText}`\n\n if (body && typeof body === 'object') {\n for (const key of errorMessageKeys) {\n if (key in body) {\n message = String((body as Record<string, unknown>)[key])\n break\n }\n }\n }\n\n const options = {\n status: response.status,\n code:\n body && typeof body === 'object' && 'code' in body\n ? (body as Record<string, unknown>).code\n : undefined,\n response: body,\n }\n\n const error = new ErrorClass(message, options)\n\n return error\n}\n\nexport function createErrorMiddleware(): Middleware {\n return {\n onResponse: async ({ response }) => {\n if (!response.ok) {\n const body = await parseResponseBody(response)\n throw createApiError(response, body)\n }\n },\n onError: async ({ error, request }) => {\n // Handle network-related errors consistently\n if (isNetworkError(error)) {\n throw new NetworkError(\n `Network error: ${error instanceof Error ? error.message : String(error)}`,\n error instanceof Error ? error : new Error(String(error)),\n {\n url: request?.url,\n method: request?.method,\n }\n )\n }\n throw error\n },\n }\n}\n", "import { ParseError } from './errors'\n\n// Type helper to extract the data type from openapi-fetch responses\nexport type ExtractDataType<T> = T extends { data?: infer D } ? NonNullable<D> : never\n\n// Helper function to extract data from openapi-fetch responses\n// Since our middleware throws on errors, successful responses will have data\nexport async function extractData<T extends { data?: unknown }>(\n responsePromise: Promise<T>\n): Promise<ExtractDataType<T>> {\n const result = await responsePromise\n const data = (result as { data?: ExtractDataType<T> }).data\n\n if (data === undefined || data === null) {\n // Invariant: our error middleware throws for non-2xx responses.\n // If we reach here without data, treat as a parse/protocol error.\n throw new ParseError('Expected response data to be present for successful request', 'response')\n }\n\n return data\n}\n\n/**\n * Parse an NDJSON HTTP response body into an async generator of parsed JSON objects.\n * The generator yields one parsed object per line. Empty lines are skipped.\n */\nexport async function* parseNdjsonStream<T = unknown>(response: Response): AsyncGenerator<T> {\n const body = response.body\n if (!body) return\n\n const reader = body.getReader()\n const decoder = new TextDecoder()\n let bufferedText = ''\n\n try {\n while (true) {\n const { done, value } = await reader.read()\n if (done) break\n bufferedText += decoder.decode(value, { stream: true })\n\n let newlineIndex: number\n // Process all complete lines in the buffer\n while ((newlineIndex = bufferedText.indexOf('\\n')) !== -1) {\n const line = bufferedText.slice(0, newlineIndex).trim()\n bufferedText = bufferedText.slice(newlineIndex + 1)\n if (!line) continue\n try {\n yield JSON.parse(line) as T\n } catch (err) {\n throw new ParseError('Failed to parse NDJSON line', 'json', err as Error)\n }\n }\n }\n\n // Flush any trailing line without a newline\n const trailing = bufferedText.trim()\n if (trailing) {\n try {\n yield JSON.parse(trailing) as T\n } catch (err) {\n throw new ParseError('Failed to parse trailing NDJSON line', 'json', err as Error)\n }\n }\n } finally {\n reader.releaseLock()\n }\n}\n\n// Utility function to safely parse response bodies without throwing errors\nexport async function parseResponseBody(response: Response): Promise<unknown> {\n try {\n const text = await response.text()\n if (!text) return undefined\n try {\n return JSON.parse(text)\n } catch {\n return text // Return as string if not valid JSON\n }\n } catch {\n return undefined // Return undefined if any error occurs\n }\n}\n\n// Helper to detect network-related errors\nexport function isNetworkError(error: unknown): boolean {\n if (!(error instanceof Error)) return false\n\n return (\n error instanceof TypeError ||\n error.message.includes('fetch') ||\n error.message.includes('Failed to fetch') ||\n error.message.includes('Network request failed') ||\n error.message.includes('ECONNREFUSED') ||\n error.message.includes('ETIMEDOUT') ||\n error.message.includes('ENOTFOUND') ||\n error.message.includes('network')\n )\n}\n", "import createClient, { type Client } from 'openapi-fetch'\nimport { createErrorMiddleware } from './errors'\nimport { createAuthMiddleware } from './auth'\nimport type { paths } from '../generated/api-types'\nimport type { AmigoSdkConfig } from '..'\nimport { createRetryingFetch } from './retry'\n\nexport type AmigoFetch = Client<paths>\n\nexport function createAmigoFetch(config: AmigoSdkConfig, mockFetch?: typeof fetch): AmigoFetch {\n const wrappedFetch = createRetryingFetch(\n config.retry,\n mockFetch ?? (globalThis.fetch as typeof fetch)\n )\n\n const client = createClient<paths>({\n baseUrl: config.baseUrl,\n fetch: wrappedFetch,\n })\n\n // Apply error handling middleware first (to catch all errors)\n client.use(createErrorMiddleware())\n\n // Apply auth middleware after error handling (so auth errors are properly handled)\n client.use(createAuthMiddleware(config))\n\n return client\n}\n", "import type { Middleware } from 'openapi-fetch'\nimport type { components } from '../generated/api-types'\nimport type { AmigoSdkConfig } from '..'\nimport { AmigoError, AuthenticationError, NetworkError, ParseError, createApiError } from './errors'\nimport { isNetworkError, parseResponseBody } from './utils'\n\ntype SignInWithApiKeyResponse = components['schemas']['user__sign_in_with_api_key__Response']\n\n/** Helper function to trade API key for a bearer token */\nexport async function getBearerToken(config: AmigoSdkConfig): Promise<SignInWithApiKeyResponse> {\n const url = `${config.baseUrl}/v1/${config.orgId}/user/signin_with_api_key`\n\n try {\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'x-api-key': config.apiKey,\n 'x-api-key-id': config.apiKeyId,\n 'x-user-id': config.userId,\n },\n })\n\n if (!response.ok) {\n const body = await parseResponseBody(response)\n const apiError = createApiError(response, body)\n\n // Enhance authentication errors with additional context\n if (response.status === 401) {\n throw new AuthenticationError(`Authentication failed: ${apiError.message}`, {\n ...apiError,\n context: { ...apiError.context, endpoint: 'signin_with_api_key' },\n })\n }\n throw apiError\n }\n\n return (await response.json()) as SignInWithApiKeyResponse\n } catch (err) {\n // Re-throw our custom errors as-is\n if (err instanceof AmigoError) {\n throw err\n }\n\n // Handle network errors\n if (isNetworkError(err)) {\n throw new NetworkError('Failed to connect to authentication endpoint', err as Error, {\n url,\n method: 'POST',\n })\n }\n\n // Handle JSON parsing errors\n throw new ParseError(\n 'Failed to parse authentication response',\n 'json',\n err instanceof Error ? err : new Error(String(err))\n )\n }\n}\n\nexport function createAuthMiddleware(config: AmigoSdkConfig): Middleware {\n let token: SignInWithApiKeyResponse | null = null\n let refreshPromise: Promise<SignInWithApiKeyResponse> | null = null\n\n const shouldRefreshToken = (tokenData: SignInWithApiKeyResponse): boolean => {\n if (!tokenData.expires_at) return false\n\n const expiryTime = new Date(tokenData.expires_at).getTime()\n const currentTime = Date.now()\n const timeUntilExpiry = expiryTime - currentTime\n const refreshThreshold = 5 * 60 * 1000 // 5 minutes in milliseconds\n\n return timeUntilExpiry <= refreshThreshold\n }\n\n const ensureValidToken = async (): Promise<SignInWithApiKeyResponse> => {\n if (!token || shouldRefreshToken(token)) {\n if (!refreshPromise) {\n refreshPromise = getBearerToken(config)\n try {\n token = await refreshPromise\n } finally {\n refreshPromise = null\n }\n } else {\n token = await refreshPromise\n }\n }\n return token\n }\n\n return {\n onRequest: async ({ request }) => {\n try {\n const validToken = await ensureValidToken()\n if (validToken?.id_token) {\n request.headers.set('Authorization', `Bearer ${validToken.id_token}`)\n }\n } catch (error) {\n // Clear token and re-throw - getBearerToken already provides proper error types\n token = null\n throw error\n }\n return request\n },\n\n onResponse: async ({ response }) => {\n // Handle 401 responses by clearing token to force refresh on next request\n if (response.status === 401) {\n token = null\n }\n },\n\n onError: async ({ error }) => {\n // Clear token on any error to force refresh\n token = null\n throw error\n },\n }\n}\n", "export type RetryOptions = {\n /** Maximum number of attempts to make (default: 3) */\n maxAttempts?: number\n /** Base delay between attempts (default: 250ms) */\n backoffBaseMs?: number\n /** Maximum delay between attempts (default: 30s) */\n maxDelayMs?: number\n /** Status codes to retry on (default: 408, 429, 500, 502, 503, 504) */\n retryOnStatus?: Set<number>\n /** Methods to retry on (default: GET) */\n retryOnMethods?: Set<string>\n}\n\nconst DEFAULT_RETRYABLE_STATUS = new Set([408, 429, 500, 502, 503, 504])\nconst DEFAULT_RETRYABLE_METHODS = new Set(['GET']) as Set<string>\n\nexport function resolveRetryOptions(options?: RetryOptions): Required<RetryOptions> {\n return {\n maxAttempts: options?.maxAttempts ?? 3,\n backoffBaseMs: options?.backoffBaseMs ?? 250,\n maxDelayMs: options?.maxDelayMs ?? 30_000,\n retryOnStatus: new Set(options?.retryOnStatus ?? DEFAULT_RETRYABLE_STATUS),\n retryOnMethods: new Set(options?.retryOnMethods ?? DEFAULT_RETRYABLE_METHODS),\n }\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, value))\n}\n\nfunction parseRetryAfterMs(headerValue: string | null, maxDelayMs: number): number | null {\n if (!headerValue) return null\n const seconds = Number(headerValue)\n if (Number.isFinite(seconds)) {\n return clamp(seconds * 1000, 0, maxDelayMs)\n }\n const date = new Date(headerValue)\n const ms = date.getTime() - Date.now()\n if (Number.isFinite(ms)) {\n return clamp(ms, 0, maxDelayMs)\n }\n return null\n}\n\nfunction computeBackoffWithJitterMs(\n attemptIndexZeroBased: number,\n baseMs: number,\n capMs: number\n): number {\n const windowMs = Math.min(capMs, baseMs * Math.pow(2, attemptIndexZeroBased))\n return Math.random() * windowMs\n}\n\nfunction isAbortError(err: unknown): boolean {\n return typeof err === 'object' && err !== null && 'name' in err && err['name'] === 'AbortError'\n}\n\nfunction isNetworkError(err: unknown): boolean {\n // Undici & browsers use TypeError for network failures\n return err instanceof TypeError && !isAbortError(err)\n}\n\nasync function abortableSleep(ms: number, signal?: AbortSignal): Promise<void> {\n if (ms <= 0) {\n signal?.throwIfAborted?.()\n return\n }\n await new Promise<void>((resolve, reject) => {\n const rejectWith =\n signal?.reason instanceof Error ? signal.reason : (signal?.reason ?? new Error('AbortError'))\n\n if (signal?.aborted) {\n reject(rejectWith)\n return\n }\n const t = setTimeout(() => {\n off()\n resolve()\n }, ms)\n const onAbort = () => {\n off()\n clearTimeout(t)\n reject(rejectWith)\n }\n const off = () => signal?.removeEventListener('abort', onAbort)\n signal?.addEventListener('abort', onAbort, { once: true })\n })\n}\n\nexport function createRetryingFetch(\n retryOptions?: RetryOptions,\n baseFetch?: typeof fetch\n): typeof fetch {\n const resolved = resolveRetryOptions(retryOptions)\n const underlying: typeof fetch = baseFetch ?? (globalThis.fetch as typeof fetch)\n\n const retryingFetch: typeof fetch = async (\n input: RequestInfo | URL,\n init?: RequestInit\n ): Promise<Response> => {\n const inputMethod =\n typeof Request !== 'undefined' && input instanceof Request ? input.method : undefined\n const method = ((init?.method ?? inputMethod ?? 'GET') as string).toUpperCase()\n const signal = init?.signal\n\n const isMethodRetryableByDefault = resolved.retryOnMethods.has(method)\n const maxAttempts = Math.max(1, resolved.maxAttempts)\n\n for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {\n let response: Response | null = null\n let error: unknown = null\n\n try {\n response = await underlying(input, init)\n } catch (err) {\n error = err\n }\n\n if (!error && response && response.ok) {\n return response\n }\n\n let shouldRetry = false\n let delayMs: number | null = null\n\n if (isNetworkError(error)) {\n shouldRetry = isMethodRetryableByDefault\n if (shouldRetry) {\n delayMs = computeBackoffWithJitterMs(\n attempt - 1,\n resolved.backoffBaseMs,\n resolved.maxDelayMs\n )\n }\n } else if (response) {\n const status = response.status\n if (method === 'POST') {\n if (status === 429) {\n const ra = response.headers.get('Retry-After')\n const parsed = parseRetryAfterMs(ra, resolved.maxDelayMs)\n if (parsed !== null) {\n shouldRetry = true\n delayMs = parsed\n }\n }\n } else if (isMethodRetryableByDefault && resolved.retryOnStatus.has(status)) {\n const ra = response.headers.get('Retry-After')\n delayMs =\n parseRetryAfterMs(ra, resolved.maxDelayMs) ??\n computeBackoffWithJitterMs(attempt - 1, resolved.backoffBaseMs, resolved.maxDelayMs)\n shouldRetry = true\n }\n }\n\n const attemptsRemain = attempt < maxAttempts\n if (!shouldRetry || !attemptsRemain) {\n if (error) throw error\n return response as Response\n }\n\n if (signal?.aborted) {\n if (error) throw error\n return response as Response\n }\n\n await abortableSleep(delayMs ?? 0, signal ?? undefined)\n }\n\n throw new Error('Retry loop exited unexpectedly')\n }\n\n return retryingFetch\n}\n\nexport type { RetryOptions as AmigoRetryOptions }\n", "import type { AmigoFetch } from '../core/openapi-client'\nimport { extractData } from '../core/utils'\nimport type { operations } from '../generated/api-types'\n\nexport class OrganizationResource {\n constructor(\n private c: AmigoFetch,\n private orgId: string\n ) {}\n\n /**\n * Get organization details\n * @param headers - The headers\n * @returns The organization details\n */\n async getOrganization(headers?: operations['get-organization']['parameters']['header']) {\n return extractData(\n this.c.GET('/v1/{organization}/organization/', {\n params: { path: { organization: this.orgId } },\n headers,\n })\n )\n }\n}\n", "import { BadRequestError } from '../core/errors'\nimport type { AmigoFetch } from '../core/openapi-client'\nimport { extractData, parseNdjsonStream } from '../core/utils'\nimport type { components, operations } from '../generated/api-types'\n\ntype VoiceData = Blob | Uint8Array | ReadableStream<Uint8Array>\nexport type InteractionInput = string | VoiceData\n\ntype InteractQuery = operations['interact-with-conversation']['parameters']['query']\ntype InteractQuerySerialized = Omit<InteractQuery, 'request_audio_config'> & {\n request_audio_config?: string | null\n}\n\nexport class ConversationResource {\n constructor(\n private c: AmigoFetch,\n private orgId: string\n ) {}\n\n async createConversation(\n body: components['schemas']['conversation__create_conversation__Request'],\n queryParams: operations['create-conversation']['parameters']['query'],\n headers?: operations['create-conversation']['parameters']['header'],\n options?: { signal?: AbortSignal }\n ) {\n const resp = await this.c.POST('/v1/{organization}/conversation/', {\n params: { path: { organization: this.orgId }, query: queryParams },\n body,\n headers: {\n Accept: 'application/x-ndjson',\n ...(headers ?? {}),\n } as operations['create-conversation']['parameters']['header'],\n // Ensure we receive a stream for NDJSON\n parseAs: 'stream',\n ...(options?.signal && { signal: options.signal }),\n })\n\n // onResponse middleware throws for non-2xx; if we reach here, it's OK.\n return parseNdjsonStream<components['schemas']['conversation__create_conversation__Response']>(\n resp.response\n )\n }\n\n async interactWithConversation(\n conversationId: string,\n input: InteractionInput,\n queryParams: operations['interact-with-conversation']['parameters']['query'],\n headers?: operations['interact-with-conversation']['parameters']['header'],\n options?: { signal?: AbortSignal }\n ) {\n // Build body based on requested format, then perform a single POST\n let bodyToSend: FormData | VoiceData\n\n // Prepare headers; we'll merge user-supplied headers and adjust per format\n const mergedHeaders: Record<string, unknown> = {\n Accept: 'application/x-ndjson',\n ...(headers ?? {}),\n }\n\n if (queryParams.request_format === 'text') {\n if (typeof input !== 'string') {\n throw new BadRequestError(\"textMessage is required when request_format is 'text'\")\n }\n const form = new FormData()\n const blob = new Blob([input], { type: 'text/plain; charset=utf-8' })\n form.append('recorded_message', blob, 'message.txt')\n bodyToSend = form\n } else if (queryParams.request_format === 'voice') {\n if (typeof input === 'string') {\n throw new BadRequestError(\n \"voice input must be a byte source when request_format is 'voice'\"\n )\n }\n bodyToSend = input\n } else {\n throw new BadRequestError('Unsupported or missing request_format in params')\n }\n\n // For text/FormData, do NOT set Content-Type; fetch will set multipart boundary\n if (queryParams.request_format === 'text') {\n delete mergedHeaders['content-type']\n delete mergedHeaders['Content-Type']\n }\n\n // For voice bytes, allow caller to specify Content-Type; if absent and input is a Blob with a type, use it\n if (queryParams.request_format === 'voice') {\n const hasContentType =\n mergedHeaders['content-type'] !== undefined || mergedHeaders['Content-Type'] !== undefined\n if (!hasContentType && typeof Blob !== 'undefined' && input instanceof Blob && input.type) {\n mergedHeaders['content-type'] = input.type\n }\n }\n\n const headersToSend =\n mergedHeaders as unknown as operations['interact-with-conversation']['parameters']['header']\n\n // Normalize nested object params that must be sent as JSON strings\n const normalizedQuery: InteractQuerySerialized = {\n ...queryParams,\n request_audio_config:\n typeof queryParams.request_audio_config === 'object' &&\n queryParams.request_audio_config !== null\n ? JSON.stringify(queryParams.request_audio_config)\n : (queryParams.request_audio_config ?? undefined),\n }\n\n const resp = await this.c.POST('/v1/{organization}/conversation/{conversation_id}/interact', {\n params: {\n path: { organization: this.orgId, conversation_id: conversationId },\n query: normalizedQuery as unknown as InteractQuery,\n header: headersToSend,\n },\n body: bodyToSend,\n parseAs: 'stream',\n ...(options?.signal && { signal: options.signal }),\n })\n\n return parseNdjsonStream<\n components['schemas']['conversation__interact_with_conversation__Response']\n >(resp.response)\n }\n\n async getConversations(\n queryParams?: operations['get-conversations']['parameters']['query'],\n headers?: operations['get-conversations']['parameters']['header']\n ) {\n return extractData(\n this.c.GET('/v1/{organization}/conversation/', {\n params: { path: { organization: this.orgId }, query: queryParams },\n headers,\n })\n )\n }\n\n async getConversationMessages(\n conversationId: string,\n queryParams?: operations['get-conversation-messages']['parameters']['query'],\n headers?: operations['get-conversation-messages']['parameters']['header']\n ) {\n return extractData(\n this.c.GET('/v1/{organization}/conversation/{conversation_id}/messages/', {\n params: {\n path: { organization: this.orgId, conversation_id: conversationId },\n query: queryParams,\n },\n headers,\n })\n )\n }\n\n async finishConversation(\n conversationId: string,\n headers?: operations['finish-conversation']['parameters']['header']\n ) {\n await this.c.POST('/v1/{organization}/conversation/{conversation_id}/finish/', {\n params: { path: { organization: this.orgId, conversation_id: conversationId } },\n headers,\n // No content is expected; parse as text to access raw Response\n parseAs: 'text',\n })\n return\n }\n\n async recommendResponsesForInteraction(\n conversationId: string,\n interactionId: string,\n headers?: operations['recommend-responses-for-interaction']['parameters']['header']\n ) {\n return extractData(\n this.c.GET(\n '/v1/{organization}/conversation/{conversation_id}/interaction/{interaction_id}/recommend_responses',\n {\n params: {\n path: {\n organization: this.orgId,\n conversation_id: conversationId,\n interaction_id: interactionId,\n },\n },\n headers,\n }\n )\n )\n }\n\n async getInteractionInsights(\n conversationId: string,\n interactionId: string,\n headers?: operations['get-interaction-insights']['parameters']['header']\n ) {\n return extractData(\n this.c.GET(\n '/v1/{organization}/conversation/{conversation_id}/interaction/{interaction_id}/insights',\n {\n params: {\n path: {\n organization: this.orgId,\n conversation_id: conversationId,\n interaction_id: interactionId,\n },\n },\n headers,\n }\n )\n )\n }\n\n // Note: the OpenAPI response schema isn't correct for this endpoint.\n // TODO -- fix response typing.\n async getMessageSource(\n conversationId: string,\n messageId: string,\n headers?: operations['retrieve-message-source']['parameters']['header']\n ) {\n return extractData(\n this.c.GET('/v1/{organization}/conversation/{conversation_id}/messages/{message_id}/source', {\n params: {\n path: {\n organization: this.orgId,\n conversation_id: conversationId,\n message_id: messageId,\n },\n },\n headers,\n })\n )\n }\n\n async generateConversationStarters(\n body: components['schemas']['conversation__generate_conversation_starter__Request'],\n headers?: operations['generate-conversation-starter']['parameters']['header']\n ) {\n return extractData(\n this.c.POST('/v1/{organization}/conversation/conversation_starter', {\n params: { path: { organization: this.orgId } },\n body,\n headers,\n })\n )\n }\n}\n", "import type { AmigoFetch } from '../core/openapi-client'\nimport { extractData } from '../core/utils'\nimport type { operations } from '../generated/api-types'\n\nexport class ServiceResource {\n constructor(\n private c: AmigoFetch,\n private orgId: string\n ) {}\n\n /**\n * Get services\n * @param headers - The headers\n * @returns The services\n */\n async getServices(\n queryParams?: operations['get-services']['parameters']['query'],\n headers?: operations['get-services']['parameters']['header']\n ) {\n return extractData(\n this.c.GET('/v1/{organization}/service/', {\n params: { path: { organization: this.orgId }, query: queryParams },\n headers,\n })\n )\n }\n}\n", "import type { AmigoFetch } from '../core/openapi-client'\nimport { extractData } from '../core/utils'\nimport type { components, operations } from '../generated/api-types'\n\nexport class UserResource {\n constructor(\n private c: AmigoFetch,\n private orgId: string\n ) {}\n\n async getUsers(\n queryParams?: operations['get-users']['parameters']['query'],\n headers?: operations['get-users']['parameters']['header']\n ) {\n return extractData(\n this.c.GET('/v1/{organization}/user/', {\n params: { path: { organization: this.orgId }, query: queryParams },\n headers,\n })\n )\n }\n\n async createUser(\n body: components['schemas']['user__create_invited_user__Request'],\n headers?: operations['create-invited-user']['parameters']['header']\n ) {\n return extractData(\n this.c.POST('/v1/{organization}/user/invite', {\n params: { path: { organization: this.orgId } },\n body,\n headers,\n })\n )\n }\n\n async deleteUser(userId: string, headers?: operations['delete-user']['parameters']['header']) {\n // DELETE endpoints returns no content (e.g., 204 No Content).\n // Our middleware already throws on non-2xx responses, so simply await the call.\n await this.c.DELETE('/v1/{organization}/user/{requested_user_id}', {\n params: { path: { organization: this.orgId, requested_user_id: userId } },\n headers,\n })\n return\n }\n\n async updateUser(\n userId: string,\n body: components['schemas']['user__update_user_info__Request'],\n headers?: operations['update-user-info']['parameters']['header']\n ) {\n // UPDATE endpoint returns no content (e.g., 204 No Content).\n // Our middleware already throws on non-2xx responses, so simply await the call.\n await this.c.POST('/v1/{organization}/user/{requested_user_id}/user', {\n params: { path: { organization: this.orgId, requested_user_id: userId } },\n body,\n headers,\n })\n return\n }\n}\n", "import { ConfigurationError } from './core/errors'\nimport { createAmigoFetch } from './core/openapi-client'\nimport { OrganizationResource } from './resources/organization'\nimport { ConversationResource } from './resources/conversation'\nimport { ServiceResource } from './resources/services'\nimport { UserResource } from './resources/user'\nimport type { RetryOptions } from './core/retry'\n\nexport interface AmigoSdkConfig {\n /** API key from Amigo dashboard */\n apiKey: string\n /** API-key ID from Amigo dashboard */\n apiKeyId: string\n /** User ID on whose behalf the request is made */\n userId: string\n /** The Organization ID */\n orgId: string\n /** Base URL of the Amigo API */\n baseUrl?: string\n /** Retry configuration for HTTP requests */\n retry?: RetryOptions\n}\n\nconst defaultBaseUrl = 'https://api.amigo.ai'\n\nexport class AmigoClient {\n readonly organizations: OrganizationResource\n readonly conversations: ConversationResource\n readonly services: ServiceResource\n readonly users: UserResource\n readonly config: AmigoSdkConfig\n\n constructor(config: AmigoSdkConfig) {\n this.config = validateConfig(config)\n\n const api = createAmigoFetch(this.config)\n this.organizations = new OrganizationResource(api, this.config.orgId)\n this.conversations = new ConversationResource(api, this.config.orgId)\n this.services = new ServiceResource(api, this.config.orgId)\n this.users = new UserResource(api, this.config.orgId)\n }\n}\n\nfunction validateConfig(config: AmigoSdkConfig) {\n if (!config.apiKey) {\n throw new ConfigurationError('API key is required', 'apiKey')\n }\n if (!config.apiKeyId) {\n throw new ConfigurationError('API key ID is required', 'apiKeyId')\n }\n if (!config.userId) {\n throw new ConfigurationError('User ID is required', 'userId')\n }\n if (!config.orgId) {\n throw new ConfigurationError('Organization ID is required', 'orgId')\n }\n if (!config.baseUrl) {\n config.baseUrl = defaultBaseUrl\n }\n return config\n}\n\n// Export all errors as a namespace to avoid polluting the main import space\nexport * as errors from './core/errors'\n\n// Re-export useful types for consumers\nexport type { components, operations, paths } from './generated/api-types'\n"],
5
- "mappings": ";;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOA,eAAsB,YACpB,iBAC6B;AAC7B,QAAM,SAAS,MAAM;AACrB,QAAM,OAAQ,OAAyC;AAEvD,MAAI,SAAS,UAAa,SAAS,MAAM;AAGvC,UAAM,IAAI,WAAW,+DAA+D,UAAU;AAAA,EAChG;AAEA,SAAO;AACT;AAMA,gBAAuB,kBAA+B,UAAuC;AAC3F,QAAM,OAAO,SAAS;AACtB,MAAI,CAAC,KAAM;AAEX,QAAM,SAAS,KAAK,UAAU;AAC9B,QAAM,UAAU,IAAI,YAAY;AAChC,MAAI,eAAe;AAEnB,MA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E,QAAQ,EAAE,MAAM,EAAE,cAAc,KAAK,OAAO,mBAAmB,OAAO,EAAE;AAAA,MACxE;AAAA,MACA;AAAA,IACF,CAAC;AACD;AAAA,EACF;AACF;;;ACpCA,IAAM,iBAAiB;AAEhB,IAAM,cAAN,MAAkB;AAAA,EAOvB,YAAY,QAAwB;AANpC,wBAAS;AACT,wBAAS;AACT,wBAAS;AACT,wBAAS;AACT,wBAAS;AAGP,SAAK,SAAS,eAAe,MAAM;AAEnC,UAAM,MAAM,iBAAiB,KAAK,MAAM;AACxC,SAAK,gBAAgB,IAAI,qBAAqB,KAAK,KAAK,OAAO,KAAK;AACpE,SAAK,gBAAgB,IAAI,qBAAqB,KAAK,KAAK,OAAO,KAAK;AACpE,SAAK,WAAW,IAAI,gBAAgB,KAAK,KAAK,OAAO,KAAK;AAC1D,SAAK,QAAQ,IAAI,aAAa,KAAK,KAAK,OAAO,KAAK;AAAA,EACtD;AACF;AAEA,SAAS,eAAe,QAAwB;AAC9C,MAAI,CAAC,OAAO,QAAQ;AAClB,UAAM,IAAI,mBAAmB,uBAAuB,QAAQ;AAAA,EAC9D;AACA,MAAI,CAAC,OAAO,UAAU;AACpB,UAAM,IAAI,mBAAmB,0BAA0B,UAAU;AAAA,EACnE;AACA,MAAI,CAAC,OAAO,QAAQ;AAClB,UAAM,IAAI,mBAAmB,uBAAuB,QAAQ;AAAA,EAC9D;AACA,MAAI,CAAC,OAAO,OAAO;AACjB,UAAM,IAAI,mBAAmB,+BAA+B,OAAO;AAAA,EACrE;AACA,MAAI,CAAC,OAAO,SAAS;AACnB,WAAO,UAAU;AAAA,EACnB;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["import type { Middleware } from 'openapi-fetch'\nimport { isNetworkError, parseResponseBody } from './utils'\n\n/**\n * Base error class for all Amigo SDK errors.\n * Provides common functionality and error identification.\n */\nexport class AmigoError extends Error {\n /**\n * Unique error code for programmatic error handling\n */\n readonly errorCode?: string\n\n /**\n * HTTP status code if applicable\n */\n readonly statusCode?: number\n\n /**\n * Additional context data\n */\n context?: Record<string, unknown>\n\n constructor(message: string, options?: Record<string, unknown>) {\n super(message)\n this.name = this.constructor.name\n\n // Ensure proper prototype chain for instanceof checks\n Object.setPrototypeOf(this, new.target.prototype)\n\n // Capture stack trace\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor)\n }\n\n // copies status, code, etc.\n Object.assign(this, options)\n }\n\n /**\n * Returns a JSON-serializable representation of the error\n */\n toJSON(): Record<string, unknown> {\n return {\n name: this.name,\n message: this.message,\n code: this.errorCode,\n statusCode: this.statusCode,\n context: this.context,\n stack: this.stack,\n }\n }\n}\n\n/* 4xx client errors */\nexport class BadRequestError extends AmigoError {}\nexport class AuthenticationError extends AmigoError {}\nexport class PermissionError extends AmigoError {}\nexport class NotFoundError extends AmigoError {}\nexport class ConflictError extends AmigoError {}\nexport class RateLimitError extends AmigoError {}\n\n/* 5xx server errors */\nexport class ServerError extends AmigoError {}\nexport class ServiceUnavailableError extends ServerError {}\n\n/* Internal SDK errors */\nexport class ConfigurationError extends AmigoError {\n constructor(\n message: string,\n public field?: string\n ) {\n super(message)\n this.context = { field }\n }\n}\n\n/* Validation errors */\nexport class ValidationError extends BadRequestError {\n constructor(\n msg: string,\n public fieldErrors?: Record<string, string>\n ) {\n super(msg)\n }\n}\n\n/* Network-related errors */\nexport class NetworkError extends AmigoError {\n constructor(\n message: string,\n public readonly originalError?: Error,\n public readonly request?: {\n url?: string\n method?: string\n }\n ) {\n super(message, { cause: originalError })\n this.context = { request }\n }\n}\n\n/* Parsing errors */\nexport class ParseError extends AmigoError {\n constructor(\n message: string,\n public readonly parseType: 'json' | 'response' | 'other',\n public readonly originalError?: Error\n ) {\n super(message, { cause: originalError })\n this.context = { parseType }\n }\n}\n\n/* Type guard functions */\nexport function isAmigoError(error: unknown): error is AmigoError {\n return error instanceof AmigoError\n}\n\n/* Error factory to create appropriate error instances from API responses */\nexport function createApiError(response: Response, body?: unknown): AmigoError {\n const map: Record<number, typeof AmigoError> = {\n 400: BadRequestError,\n 401: AuthenticationError,\n 403: PermissionError,\n 404: NotFoundError,\n 409: ConflictError,\n 422: ValidationError,\n 429: RateLimitError,\n 500: ServerError,\n 503: ServiceUnavailableError,\n }\n\n const errorMessageKeys = ['message', 'error', 'detail']\n\n const ErrorClass = map[response.status] ?? AmigoError\n let message = `HTTP ${response.status} ${response.statusText}`\n\n if (body && typeof body === 'object') {\n for (const key of errorMessageKeys) {\n if (key in body) {\n message = String((body as Record<string, unknown>)[key])\n break\n }\n }\n }\n\n const options = {\n status: response.status,\n code:\n body && typeof body === 'object' && 'code' in body\n ? (body as Record<string, unknown>).code\n : undefined,\n response: body,\n }\n\n const error = new ErrorClass(message, options)\n\n return error\n}\n\nexport function createErrorMiddleware(): Middleware {\n return {\n onResponse: async ({ response }) => {\n if (!response.ok) {\n const body = await parseResponseBody(response)\n throw createApiError(response, body)\n }\n },\n onError: async ({ error, request }) => {\n // Handle network-related errors consistently\n if (isNetworkError(error)) {\n throw new NetworkError(\n `Network error: ${error instanceof Error ? error.message : String(error)}`,\n error instanceof Error ? error : new Error(String(error)),\n {\n url: request?.url,\n method: request?.method,\n }\n )\n }\n throw error\n },\n }\n}\n", "import { ParseError } from './errors'\n\n// Type helper to extract the data type from openapi-fetch responses\nexport type ExtractDataType<T> = T extends { data?: infer D } ? NonNullable<D> : never\n\n// Helper function to extract data from openapi-fetch responses\n// Since our middleware throws on errors, successful responses will have data\nexport async function extractData<T extends { data?: unknown }>(\n responsePromise: Promise<T>\n): Promise<ExtractDataType<T>> {\n const result = await responsePromise\n const data = (result as { data?: ExtractDataType<T> }).data\n\n if (data === undefined || data === null) {\n // Invariant: our error middleware throws for non-2xx responses.\n // If we reach here without data, treat as a parse/protocol error.\n throw new ParseError('Expected response data to be present for successful request', 'response')\n }\n\n return data\n}\n\n/**\n * Parse an NDJSON HTTP response body into an async generator of parsed JSON objects.\n * The generator yields one parsed object per line. Empty lines are skipped.\n */\nexport async function* parseNdjsonStream<T = unknown>(response: Response): AsyncGenerator<T> {\n const body = response.body\n if (!body) return\n\n const reader = body.getReader()\n const decoder = new TextDecoder()\n let bufferedText = ''\n\n try {\n while (true) {\n const { done, value } = await reader.read()\n if (done) break\n bufferedText += decoder.decode(value, { stream: true })\n\n let newlineIndex: number\n // Process all complete lines in the buffer\n while ((newlineIndex = bufferedText.indexOf('\\n')) !== -1) {\n const line = bufferedText.slice(0, newlineIndex).trim()\n bufferedText = bufferedText.slice(newlineIndex + 1)\n if (!line) continue\n try {\n yield JSON.parse(line) as T\n } catch (err) {\n throw new ParseError('Failed to parse NDJSON line', 'json', err as Error)\n }\n }\n }\n\n // Flush any trailing line without a newline\n const trailing = bufferedText.trim()\n if (trailing) {\n try {\n yield JSON.parse(trailing) as T\n } catch (err) {\n throw new ParseError('Failed to parse trailing NDJSON line', 'json', err as Error)\n }\n }\n } finally {\n reader.releaseLock()\n }\n}\n\n// Utility function to safely parse response bodies without throwing errors\nexport async function parseResponseBody(response: Response): Promise<unknown> {\n try {\n const text = await response.text()\n if (!text) return undefined\n try {\n return JSON.parse(text)\n } catch {\n return text // Return as string if not valid JSON\n }\n } catch {\n return undefined // Return undefined if any error occurs\n }\n}\n\n// Helper to detect network-related errors\nexport function isNetworkError(error: unknown): boolean {\n if (!(error instanceof Error)) return false\n\n return (\n error instanceof TypeError ||\n error.message.includes('fetch') ||\n error.message.includes('Failed to fetch') ||\n error.message.includes('Network request failed') ||\n error.message.includes('ECONNREFUSED') ||\n error.message.includes('ETIMEDOUT') ||\n error.message.includes('ENOTFOUND') ||\n error.message.includes('network')\n )\n}\n", "import createClient, { type Client } from 'openapi-fetch'\nimport { createErrorMiddleware } from './errors'\nimport { createAuthMiddleware } from './auth'\nimport type { paths } from '../generated/api-types'\nimport type { AmigoSdkConfig } from '..'\nimport { createRetryingFetch } from './retry'\n\nexport type AmigoFetch = Client<paths>\n\nexport function createAmigoFetch(config: AmigoSdkConfig, mockFetch?: typeof fetch): AmigoFetch {\n const wrappedFetch = createRetryingFetch(\n config.retry,\n mockFetch ?? (globalThis.fetch as typeof fetch)\n )\n\n const client = createClient<paths>({\n baseUrl: config.baseUrl,\n fetch: wrappedFetch,\n })\n\n // Apply error handling middleware first (to catch all errors)\n client.use(createErrorMiddleware())\n\n // Apply auth middleware after error handling (so auth errors are properly handled)\n client.use(createAuthMiddleware(config))\n\n return client\n}\n", "import type { Middleware } from 'openapi-fetch'\nimport type { components } from '../generated/api-types'\nimport type { AmigoSdkConfig } from '..'\nimport { AmigoError, AuthenticationError, NetworkError, ParseError, createApiError } from './errors'\nimport { isNetworkError, parseResponseBody } from './utils'\n\ntype SignInWithApiKeyResponse = components['schemas']['user__sign_in_with_api_key__Response']\n\n/** Helper function to trade API key for a bearer token */\nexport async function getBearerToken(config: AmigoSdkConfig): Promise<SignInWithApiKeyResponse> {\n const url = `${config.baseUrl}/v1/${config.orgId}/user/signin_with_api_key`\n\n try {\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'x-api-key': config.apiKey,\n 'x-api-key-id': config.apiKeyId,\n 'x-user-id': config.userId,\n },\n })\n\n if (!response.ok) {\n const body = await parseResponseBody(response)\n const apiError = createApiError(response, body)\n\n // Enhance authentication errors with additional context\n if (response.status === 401) {\n throw new AuthenticationError(`Authentication failed: ${apiError.message}`, {\n ...apiError,\n context: { ...apiError.context, endpoint: 'signin_with_api_key' },\n })\n }\n throw apiError\n }\n\n return (await response.json()) as SignInWithApiKeyResponse\n } catch (err) {\n // Re-throw our custom errors as-is\n if (err instanceof AmigoError) {\n throw err\n }\n\n // Handle network errors\n if (isNetworkError(err)) {\n throw new NetworkError('Failed to connect to authentication endpoint', err as Error, {\n url,\n method: 'POST',\n })\n }\n\n // Handle JSON parsing errors\n throw new ParseError(\n 'Failed to parse authentication response',\n 'json',\n err instanceof Error ? err : new Error(String(err))\n )\n }\n}\n\nexport function createAuthMiddleware(config: AmigoSdkConfig): Middleware {\n let token: SignInWithApiKeyResponse | null = null\n let refreshPromise: Promise<SignInWithApiKeyResponse> | null = null\n\n const shouldRefreshToken = (tokenData: SignInWithApiKeyResponse): boolean => {\n if (!tokenData.expires_at) return false\n\n const expiryTime = new Date(tokenData.expires_at).getTime()\n const currentTime = Date.now()\n const timeUntilExpiry = expiryTime - currentTime\n const refreshThreshold = 5 * 60 * 1000 // 5 minutes in milliseconds\n\n return timeUntilExpiry <= refreshThreshold\n }\n\n const ensureValidToken = async (): Promise<SignInWithApiKeyResponse> => {\n if (!token || shouldRefreshToken(token)) {\n if (!refreshPromise) {\n refreshPromise = getBearerToken(config)\n try {\n token = await refreshPromise\n } finally {\n refreshPromise = null\n }\n } else {\n token = await refreshPromise\n }\n }\n return token\n }\n\n return {\n onRequest: async ({ request }) => {\n try {\n const validToken = await ensureValidToken()\n if (validToken?.id_token) {\n request.headers.set('Authorization', `Bearer ${validToken.id_token}`)\n }\n } catch (error) {\n // Clear token and re-throw - getBearerToken already provides proper error types\n token = null\n throw error\n }\n return request\n },\n\n onResponse: async ({ response }) => {\n // Handle 401 responses by clearing token to force refresh on next request\n if (response.status === 401) {\n token = null\n }\n },\n\n onError: async ({ error }) => {\n // Clear token on any error to force refresh\n token = null\n throw error\n },\n }\n}\n", "export type RetryOptions = {\n /** Maximum number of attempts to make (default: 3) */\n maxAttempts?: number\n /** Base delay between attempts (default: 250ms) */\n backoffBaseMs?: number\n /** Maximum delay between attempts (default: 30s) */\n maxDelayMs?: number\n /** Status codes to retry on (default: 408, 429, 500, 502, 503, 504) */\n retryOnStatus?: Set<number>\n /** Methods to retry on (default: GET) */\n retryOnMethods?: Set<string>\n}\n\nconst DEFAULT_RETRYABLE_STATUS = new Set([408, 429, 500, 502, 503, 504])\nconst DEFAULT_RETRYABLE_METHODS = new Set(['GET']) as Set<string>\n\nexport function resolveRetryOptions(options?: RetryOptions): Required<RetryOptions> {\n return {\n maxAttempts: options?.maxAttempts ?? 3,\n backoffBaseMs: options?.backoffBaseMs ?? 250,\n maxDelayMs: options?.maxDelayMs ?? 30_000,\n retryOnStatus: new Set(options?.retryOnStatus ?? DEFAULT_RETRYABLE_STATUS),\n retryOnMethods: new Set(options?.retryOnMethods ?? DEFAULT_RETRYABLE_METHODS),\n }\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, value))\n}\n\nfunction parseRetryAfterMs(headerValue: string | null, maxDelayMs: number): number | null {\n if (!headerValue) return null\n const seconds = Number(headerValue)\n if (Number.isFinite(seconds)) {\n return clamp(seconds * 1000, 0, maxDelayMs)\n }\n const date = new Date(headerValue)\n const ms = date.getTime() - Date.now()\n if (Number.isFinite(ms)) {\n return clamp(ms, 0, maxDelayMs)\n }\n return null\n}\n\nfunction computeBackoffWithJitterMs(\n attemptIndexZeroBased: number,\n baseMs: number,\n capMs: number\n): number {\n const windowMs = Math.min(capMs, baseMs * Math.pow(2, attemptIndexZeroBased))\n return Math.random() * windowMs\n}\n\nfunction isAbortError(err: unknown): boolean {\n return typeof err === 'object' && err !== null && 'name' in err && err['name'] === 'AbortError'\n}\n\nfunction isNetworkError(err: unknown): boolean {\n // Undici & browsers use TypeError for network failures\n return err instanceof TypeError && !isAbortError(err)\n}\n\nasync function abortableSleep(ms: number, signal?: AbortSignal): Promise<void> {\n if (ms <= 0) {\n signal?.throwIfAborted?.()\n return\n }\n await new Promise<void>((resolve, reject) => {\n const rejectWith =\n signal?.reason instanceof Error ? signal.reason : (signal?.reason ?? new Error('AbortError'))\n\n if (signal?.aborted) {\n reject(rejectWith)\n return\n }\n const t = setTimeout(() => {\n off()\n resolve()\n }, ms)\n const onAbort = () => {\n off()\n clearTimeout(t)\n reject(rejectWith)\n }\n const off = () => signal?.removeEventListener('abort', onAbort)\n signal?.addEventListener('abort', onAbort, { once: true })\n })\n}\n\nexport function createRetryingFetch(\n retryOptions?: RetryOptions,\n baseFetch?: typeof fetch\n): typeof fetch {\n const resolved = resolveRetryOptions(retryOptions)\n const underlying: typeof fetch = baseFetch ?? (globalThis.fetch as typeof fetch)\n\n const retryingFetch: typeof fetch = async (\n input: RequestInfo | URL,\n init?: RequestInit\n ): Promise<Response> => {\n const inputMethod =\n typeof Request !== 'undefined' && input instanceof Request ? input.method : undefined\n const method = ((init?.method ?? inputMethod ?? 'GET') as string).toUpperCase()\n const signal = init?.signal\n\n const isMethodRetryableByDefault = resolved.retryOnMethods.has(method)\n const maxAttempts = Math.max(1, resolved.maxAttempts)\n\n for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {\n let response: Response | null = null\n let error: unknown = null\n\n try {\n response = await underlying(input, init)\n } catch (err) {\n error = err\n }\n\n if (!error && response && response.ok) {\n return response\n }\n\n let shouldRetry = false\n let delayMs: number | null = null\n\n if (isNetworkError(error)) {\n shouldRetry = isMethodRetryableByDefault\n if (shouldRetry) {\n delayMs = computeBackoffWithJitterMs(\n attempt - 1,\n resolved.backoffBaseMs,\n resolved.maxDelayMs\n )\n }\n } else if (response) {\n const status = response.status\n if (method === 'POST') {\n if (status === 429) {\n const ra = response.headers.get('Retry-After')\n const parsed = parseRetryAfterMs(ra, resolved.maxDelayMs)\n if (parsed !== null) {\n shouldRetry = true\n delayMs = parsed\n }\n }\n } else if (isMethodRetryableByDefault && resolved.retryOnStatus.has(status)) {\n const ra = response.headers.get('Retry-After')\n delayMs =\n parseRetryAfterMs(ra, resolved.maxDelayMs) ??\n computeBackoffWithJitterMs(attempt - 1, resolved.backoffBaseMs, resolved.maxDelayMs)\n shouldRetry = true\n }\n }\n\n const attemptsRemain = attempt < maxAttempts\n if (!shouldRetry || !attemptsRemain) {\n if (error) throw error\n return response as Response\n }\n\n if (signal?.aborted) {\n if (error) throw error\n return response as Response\n }\n\n await abortableSleep(delayMs ?? 0, signal ?? undefined)\n }\n\n throw new Error('Retry loop exited unexpectedly')\n }\n\n return retryingFetch\n}\n\nexport type { RetryOptions as AmigoRetryOptions }\n", "import type { AmigoFetch } from '../core/openapi-client'\nimport { extractData } from '../core/utils'\nimport type { operations } from '../generated/api-types'\n\nexport class OrganizationResource {\n constructor(\n private c: AmigoFetch,\n private orgId: string\n ) {}\n\n /**\n * Get organization details\n * @param headers - The headers\n * @returns The organization details\n */\n async getOrganization(headers?: operations['get-organization']['parameters']['header']) {\n return extractData(\n this.c.GET('/v1/{organization}/organization/', {\n params: { path: { organization: this.orgId } },\n headers,\n })\n )\n }\n}\n", "import { BadRequestError } from '../core/errors'\nimport type { AmigoFetch } from '../core/openapi-client'\nimport { extractData, parseNdjsonStream } from '../core/utils'\nimport type { components, operations } from '../generated/api-types'\n\ntype VoiceData = Blob | Uint8Array | ReadableStream<Uint8Array>\nexport type InteractionInput = string | VoiceData\n\ntype InteractQuery = operations['interact-with-conversation']['parameters']['query']\ntype InteractQuerySerialized = Omit<InteractQuery, 'request_audio_config'> & {\n request_audio_config?: string | null\n}\n\nexport class ConversationResource {\n constructor(\n private c: AmigoFetch,\n private orgId: string\n ) {}\n\n async createConversation(\n body: components['schemas']['conversation__create_conversation__Request'],\n queryParams: operations['create-conversation']['parameters']['query'],\n headers?: operations['create-conversation']['parameters']['header'],\n options?: { signal?: AbortSignal }\n ) {\n const resp = await this.c.POST('/v1/{organization}/conversation/', {\n params: { path: { organization: this.orgId }, query: queryParams },\n body,\n headers: {\n Accept: 'application/x-ndjson',\n ...(headers ?? {}),\n } as operations['create-conversation']['parameters']['header'],\n // Ensure we receive a stream for NDJSON\n parseAs: 'stream',\n ...(options?.signal && { signal: options.signal }),\n })\n\n // onResponse middleware throws for non-2xx; if we reach here, it's OK.\n return parseNdjsonStream<components['schemas']['conversation__create_conversation__Response']>(\n resp.response\n )\n }\n\n async interactWithConversation(\n conversationId: string,\n input: InteractionInput,\n queryParams: operations['interact-with-conversation']['parameters']['query'],\n headers?: operations['interact-with-conversation']['parameters']['header'],\n options?: { signal?: AbortSignal }\n ) {\n // Build body based on requested format, then perform a single POST\n let bodyToSend: FormData | VoiceData\n\n // Prepare headers; we'll merge user-supplied headers and adjust per format\n const mergedHeaders: Record<string, unknown> = {\n Accept: 'application/x-ndjson',\n ...(headers ?? {}),\n }\n\n if (queryParams.request_format === 'text') {\n if (typeof input !== 'string') {\n throw new BadRequestError(\"textMessage is required when request_format is 'text'\")\n }\n const form = new FormData()\n const blob = new Blob([input], { type: 'text/plain; charset=utf-8' })\n form.append('recorded_message', blob, 'message.txt')\n bodyToSend = form\n } else if (queryParams.request_format === 'voice') {\n if (typeof input === 'string') {\n throw new BadRequestError(\n \"voice input must be a byte source when request_format is 'voice'\"\n )\n }\n bodyToSend = input\n } else {\n throw new BadRequestError('Unsupported or missing request_format in params')\n }\n\n // For text/FormData, do NOT set Content-Type; fetch will set multipart boundary\n if (queryParams.request_format === 'text') {\n delete mergedHeaders['content-type']\n delete mergedHeaders['Content-Type']\n }\n\n // For voice bytes, allow caller to specify Content-Type; if absent and input is a Blob with a type, use it\n if (queryParams.request_format === 'voice') {\n const hasContentType =\n mergedHeaders['content-type'] !== undefined || mergedHeaders['Content-Type'] !== undefined\n if (!hasContentType && typeof Blob !== 'undefined' && input instanceof Blob && input.type) {\n mergedHeaders['content-type'] = input.type\n }\n }\n\n const headersToSend =\n mergedHeaders as unknown as operations['interact-with-conversation']['parameters']['header']\n\n // Normalize nested object params that must be sent as JSON strings\n const normalizedQuery: InteractQuerySerialized = {\n ...queryParams,\n request_audio_config:\n typeof queryParams.request_audio_config === 'object' &&\n queryParams.request_audio_config !== null\n ? JSON.stringify(queryParams.request_audio_config)\n : (queryParams.request_audio_config ?? undefined),\n }\n\n const resp = await this.c.POST('/v1/{organization}/conversation/{conversation_id}/interact', {\n params: {\n path: { organization: this.orgId, conversation_id: conversationId },\n query: normalizedQuery as unknown as InteractQuery,\n header: headersToSend,\n },\n body: bodyToSend,\n parseAs: 'stream',\n ...(options?.signal && { signal: options.signal }),\n })\n\n return parseNdjsonStream<\n components['schemas']['conversation__interact_with_conversation__Response']\n >(resp.response)\n }\n\n async getConversations(\n queryParams?: operations['get-conversations']['parameters']['query'],\n headers?: operations['get-conversations']['parameters']['header']\n ) {\n return extractData(\n this.c.GET('/v1/{organization}/conversation/', {\n params: { path: { organization: this.orgId }, query: queryParams },\n headers,\n })\n )\n }\n\n async getConversationMessages(\n conversationId: string,\n queryParams?: operations['get-conversation-messages']['parameters']['query'],\n headers?: operations['get-conversation-messages']['parameters']['header']\n ) {\n return extractData(\n this.c.GET('/v1/{organization}/conversation/{conversation_id}/messages/', {\n params: {\n path: { organization: this.orgId, conversation_id: conversationId },\n query: queryParams,\n },\n headers,\n })\n )\n }\n\n async finishConversation(\n conversationId: string,\n headers?: operations['finish-conversation']['parameters']['header']\n ) {\n await this.c.POST('/v1/{organization}/conversation/{conversation_id}/finish/', {\n params: { path: { organization: this.orgId, conversation_id: conversationId } },\n headers,\n // No content is expected; parse as text to access raw Response\n parseAs: 'text',\n })\n return\n }\n\n async recommendResponsesForInteraction(\n conversationId: string,\n interactionId: string,\n headers?: operations['recommend-responses-for-interaction']['parameters']['header']\n ) {\n return extractData(\n this.c.GET(\n '/v1/{organization}/conversation/{conversation_id}/interaction/{interaction_id}/recommend_responses',\n {\n params: {\n path: {\n organization: this.orgId,\n conversation_id: conversationId,\n interaction_id: interactionId,\n },\n },\n headers,\n }\n )\n )\n }\n\n async getInteractionInsights(\n conversationId: string,\n interactionId: string,\n headers?: operations['get-interaction-insights']['parameters']['header']\n ) {\n return extractData(\n this.c.GET(\n '/v1/{organization}/conversation/{conversation_id}/interaction/{interaction_id}/insights',\n {\n params: {\n path: {\n organization: this.orgId,\n conversation_id: conversationId,\n interaction_id: interactionId,\n },\n },\n headers,\n }\n )\n )\n }\n\n // Note: the OpenAPI response schema isn't correct for this endpoint.\n // TODO -- fix response typing.\n async getMessageSource(\n conversationId: string,\n messageId: string,\n headers?: operations['retrieve-message-source']['parameters']['header']\n ) {\n return extractData(\n this.c.GET('/v1/{organization}/conversation/{conversation_id}/messages/{message_id}/source', {\n params: {\n path: {\n organization: this.orgId,\n conversation_id: conversationId,\n message_id: messageId,\n },\n },\n headers,\n })\n )\n }\n\n async generateConversationStarters(\n body: components['schemas']['conversation__generate_conversation_starter__Request'],\n headers?: operations['generate-conversation-starter']['parameters']['header']\n ) {\n return extractData(\n this.c.POST('/v1/{organization}/conversation/conversation_starter', {\n params: { path: { organization: this.orgId } },\n body,\n headers,\n })\n )\n }\n}\n", "import type { AmigoFetch } from '../core/openapi-client'\nimport { extractData } from '../core/utils'\nimport type { operations } from '../generated/api-types'\n\nexport class ServiceResource {\n constructor(\n private c: AmigoFetch,\n private orgId: string\n ) {}\n\n /**\n * Get services\n * @param headers - The headers\n * @returns The services\n */\n async getServices(\n queryParams?: operations['get-services']['parameters']['query'],\n headers?: operations['get-services']['parameters']['header']\n ) {\n return extractData(\n this.c.GET('/v1/{organization}/service/', {\n params: { path: { organization: this.orgId }, query: queryParams },\n headers,\n })\n )\n }\n}\n", "import type { AmigoFetch } from '../core/openapi-client'\nimport { extractData } from '../core/utils'\nimport type { components, operations } from '../generated/api-types'\n\nexport class UserResource {\n constructor(\n private c: AmigoFetch,\n private orgId: string\n ) {}\n\n async getUsers(\n queryParams?: operations['get-users']['parameters']['query'],\n headers?: operations['get-users']['parameters']['header']\n ) {\n return extractData(\n this.c.GET('/v1/{organization}/user/', {\n params: { path: { organization: this.orgId }, query: queryParams },\n headers,\n })\n )\n }\n\n async createUser(\n body: components['schemas']['user__create_invited_user__Request'],\n headers?: operations['create-invited-user']['parameters']['header']\n ) {\n return extractData(\n this.c.POST('/v1/{organization}/user/', {\n params: { path: { organization: this.orgId } },\n body,\n headers,\n })\n )\n }\n\n async deleteUser(userId: string, headers?: operations['delete-user']['parameters']['header']) {\n // DELETE endpoints returns no content (e.g., 204 No Content).\n // Our middleware already throws on non-2xx responses, so simply await the call.\n await this.c.DELETE('/v1/{organization}/user/{requested_user_id}', {\n params: { path: { organization: this.orgId, requested_user_id: userId } },\n headers,\n })\n return\n }\n\n async updateUser(\n userId: string,\n body: components['schemas']['user__update_user_info__Request'],\n headers?: operations['update-user-info']['parameters']['header']\n ) {\n // UPDATE endpoint returns no content (e.g., 204 No Content).\n // Our middleware already throws on non-2xx responses, so simply await the call.\n await this.c.POST('/v1/{organization}/user/{requested_user_id}/user', {\n params: { path: { organization: this.orgId, requested_user_id: userId } },\n body,\n headers,\n })\n return\n }\n}\n", "import { ConfigurationError } from './core/errors'\nimport { createAmigoFetch } from './core/openapi-client'\nimport { OrganizationResource } from './resources/organization'\nimport { ConversationResource } from './resources/conversation'\nimport { ServiceResource } from './resources/services'\nimport { UserResource } from './resources/user'\nimport type { RetryOptions } from './core/retry'\n\nexport interface AmigoSdkConfig {\n /** API key from Amigo dashboard */\n apiKey: string\n /** API-key ID from Amigo dashboard */\n apiKeyId: string\n /** User ID on whose behalf the request is made */\n userId: string\n /** The Organization ID */\n orgId: string\n /** Base URL of the Amigo API */\n baseUrl?: string\n /** Retry configuration for HTTP requests */\n retry?: RetryOptions\n}\n\nconst defaultBaseUrl = 'https://api.amigo.ai'\n\nexport class AmigoClient {\n readonly organizations: OrganizationResource\n readonly conversations: ConversationResource\n readonly services: ServiceResource\n readonly users: UserResource\n readonly config: AmigoSdkConfig\n\n constructor(config: AmigoSdkConfig) {\n this.config = validateConfig(config)\n\n const api = createAmigoFetch(this.config)\n this.organizations = new OrganizationResource(api, this.config.orgId)\n this.conversations = new ConversationResource(api, this.config.orgId)\n this.services = new ServiceResource(api, this.config.orgId)\n this.users = new UserResource(api, this.config.orgId)\n }\n}\n\nfunction validateConfig(config: AmigoSdkConfig) {\n if (!config.apiKey) {\n throw new ConfigurationError('API key is required', 'apiKey')\n }\n if (!config.apiKeyId) {\n throw new ConfigurationError('API key ID is required', 'apiKeyId')\n }\n if (!config.userId) {\n throw new ConfigurationError('User ID is required', 'userId')\n }\n if (!config.orgId) {\n throw new ConfigurationError('Organization ID is required', 'orgId')\n }\n if (!config.baseUrl) {\n config.baseUrl = defaultBaseUrl\n }\n return config\n}\n\n// Export all errors as a namespace to avoid polluting the main import space\nexport * as errors from './core/errors'\n\n// Re-export useful types for consumers\nexport type { components, operations, paths } from './generated/api-types'\n"],
5
+ "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AmB,0BAA0B,UAAU;AAAA,EACnE;AACA,MAAI,CAAC,OAAO,QAAQ;AAClB,UAAM,IAAI,mBAAmB,uBAAuB,QAAQ;AAAA,EAC9D;AACA,MAAI,CAAC,OAAO,OAAO;AACjB,UAAM,IAAI,mBAAmB,+BAA+B,OAAO;AAAA,EACrE;AACA,MAAI,CAAC,OAAO,SAAS;AACnB,WAAO,UAAU;AAAA,EACnB;AACA,SAAO;AACT;",
6
6
  "names": ["isNetworkError"]
7
7
  }
@@ -599,7 +599,8 @@ export interface paths {
599
599
  cookie?: never;
600
600
  };
601
601
  /**
602
- * Recommend responses for interaction
602
+ * Recommend responses for interaction (Deprecated)
603
+ * @deprecated
603
604
  * @description Generate a recommended response for the user to send based on the existing chat history. This should be called when the most recent interaction
604
605
  * had concluded for a while but the user still hasn't responded.
605
606
  *
@@ -607,9 +608,18 @@ export interface paths {
607
608
  * This endpoint requires the following permissions:
608
609
  * * `Conversation:GetRecommendedResponses` on this conversation.
609
610
  */
610
- get: operations["recommend-responses-for-interaction"];
611
+ get: operations["recommend_responses_for_interaction_v1__organization__conversation__conversation_id__interaction__interaction_id__recommend_responses_get"];
611
612
  put?: never;
612
- post?: never;
613
+ /**
614
+ * Recommend responses for interaction
615
+ * @description Generate a recommended response for the user to send based on the existing chat history. This should be called when the most recent interaction
616
+ * had concluded for a while but the user still hasn't responded.
617
+ *
618
+ * #### Permissions:
619
+ * This endpoint requires the following permissions:
620
+ * * `Conversation:GetRecommendedResponses` on this conversation.
621
+ */
622
+ post: operations["recommend-responses-for-interaction"];
613
623
  delete?: never;
614
624
  options?: never;
615
625
  head?: never;
@@ -3360,9 +3370,9 @@ export interface components {
3360
3370
  type: "jumpback";
3361
3371
  };
3362
3372
  /** @enum {string} */
3363
- LLMLoadBalancingSetType: "o4-mini-2025-04-16" | "gpt-5-2025-08-07" | "gpt-5-mini-2025-08-07" | "gpt-5-nano-2025-08-07" | "claude-sonnet-4-20250514";
3373
+ LLMLoadBalancingSetType: "o4-mini-2025-04-16" | "gpt-5-2025-08-07" | "gpt-5-mini-2025-08-07" | "gpt-5-nano-2025-08-07" | "claude-sonnet-4-5-20250929";
3364
3374
  /** @enum {string} */
3365
- LLMType: "openai_o4-mini-2025-04-16" | "openai_gpt-5-2025-08-07" | "openai_gpt-5-mini-2025-08-07" | "openai_gpt-5-nano-2025-08-07" | "azure_o4-mini-2025-04-16" | "azure_gpt-4.1-2025-04-14" | "azure_gpt-4.1-mini-2025-04-14" | "azure_gpt-5-2025-08-07" | "azure_gpt-5-mini-2025-08-07" | "azure_gpt-5-nano-2025-08-07" | "google_claude-sonnet-4@20250514" | "aws_claude-sonnet-4-20250514" | "anthropic_claude-sonnet-4-20250514" | "google_gemini-2.5-pro" | "google_gemini-2.5-flash";
3375
+ LLMType: "openai_o4-mini-2025-04-16" | "openai_gpt-5-2025-08-07" | "openai_gpt-5-mini-2025-08-07" | "openai_gpt-5-nano-2025-08-07" | "azure_o4-mini-2025-04-16" | "azure_gpt-4.1-2025-04-14" | "azure_gpt-4.1-mini-2025-04-14" | "azure_gpt-5-2025-08-07" | "azure_gpt-5-mini-2025-08-07" | "azure_gpt-5-nano-2025-08-07" | "google_claude-sonnet-4-5@20250929" | "aws_claude-sonnet-4-5-20250929" | "anthropic_claude-sonnet-4-5-20250929" | "google_gemini-2.5-pro" | "google_gemini-2.5-flash";
3366
3376
  /** MP3UserMessageAudioConfig */
3367
3377
  MP3UserMessageAudioConfig: {
3368
3378
  /**
@@ -3516,7 +3526,7 @@ export interface components {
3516
3526
  * Tags
3517
3527
  * @description The tags of the metric.
3518
3528
  */
3519
- tags: components["schemas"]["amigo_lib__mongo__collections__simulation_unit_test__SimulationUnitTest__Tag"][];
3529
+ tags: components["schemas"]["amigo_lib__mongo__collections__service__Service__Tag"][];
3520
3530
  /** @description The user who created the metric. */
3521
3531
  creator: components["schemas"]["amigo_lib__mongo__collections__metric__Metric__UserInfo"];
3522
3532
  /** @description The user who last updated the metric. */
@@ -3621,7 +3631,7 @@ export interface components {
3621
3631
  * Tags
3622
3632
  * @description The tags of the metric.
3623
3633
  */
3624
- tags: components["schemas"]["amigo_lib__mongo__collections__simulation_unit_test__SimulationUnitTest__Tag"][];
3634
+ tags: components["schemas"]["amigo_lib__mongo__collections__service__Service__Tag"][];
3625
3635
  /** @description The user who created the metric. */
3626
3636
  creator: components["schemas"]["amigo_lib__mongo__collections__metric__Metric__UserInfo"];
3627
3637
  /** @description The user who last updated the metric. */
@@ -4485,7 +4495,7 @@ export interface components {
4485
4495
  * Tags
4486
4496
  * @description The tags of the service.
4487
4497
  */
4488
- tags: components["schemas"]["amigo_lib__mongo__collections__simulation_unit_test__SimulationUnitTest__Tag"][];
4498
+ tags: components["schemas"]["amigo_lib__mongo__collections__service__Service__Tag"][];
4489
4499
  };
4490
4500
  /** SimulationConversationInvocationSource */
4491
4501
  SimulationConversationInvocationSource: {
@@ -4695,7 +4705,7 @@ export interface components {
4695
4705
  * Tags
4696
4706
  * @description The tags of the simulation persona.
4697
4707
  */
4698
- tags: components["schemas"]["amigo_lib__mongo__collections__simulation_unit_test__SimulationUnitTest__Tag"][];
4708
+ tags: components["schemas"]["amigo_lib__mongo__collections__service__Service__Tag"][];
4699
4709
  creator: components["schemas"]["amigo_lib__mongo__collections__simulation_unit_test__SimulationUnitTest__UserInfo"];
4700
4710
  updated_by: components["schemas"]["amigo_lib__mongo__collections__simulation_unit_test__SimulationUnitTest__UserInfo"];
4701
4711
  };
@@ -4767,7 +4777,7 @@ export interface components {
4767
4777
  * Tags
4768
4778
  * @description The tags of the simulation persona.
4769
4779
  */
4770
- tags: components["schemas"]["amigo_lib__mongo__collections__simulation_unit_test__SimulationUnitTest__Tag"][];
4780
+ tags: components["schemas"]["amigo_lib__mongo__collections__service__Service__Tag"][];
4771
4781
  creator: components["schemas"]["amigo_lib__mongo__collections__simulation_unit_test__SimulationUnitTest__UserInfo"];
4772
4782
  updated_by: components["schemas"]["amigo_lib__mongo__collections__simulation_unit_test__SimulationUnitTest__UserInfo"];
4773
4783
  };
@@ -4822,7 +4832,7 @@ export interface components {
4822
4832
  * Tags
4823
4833
  * @description The tags of the simulation unit test set.
4824
4834
  */
4825
- tags: components["schemas"]["amigo_lib__mongo__collections__simulation_unit_test__SimulationUnitTest__Tag"][];
4835
+ tags: components["schemas"]["amigo_lib__mongo__collections__service__Service__Tag"][];
4826
4836
  creator: components["schemas"]["amigo_lib__mongo__collections__simulation_unit_test_set__SimulationUnitTestSet__UserInfo"];
4827
4837
  updated_by: components["schemas"]["amigo_lib__mongo__collections__simulation_unit_test_set__SimulationUnitTestSet__UserInfo"];
4828
4838
  };
@@ -4874,7 +4884,7 @@ export interface components {
4874
4884
  * Tags
4875
4885
  * @description The tags of the simulation unit test set.
4876
4886
  */
4877
- tags: components["schemas"]["amigo_lib__mongo__collections__simulation_unit_test__SimulationUnitTest__Tag"][];
4887
+ tags: components["schemas"]["amigo_lib__mongo__collections__service__Service__Tag"][];
4878
4888
  creator: components["schemas"]["amigo_lib__mongo__collections__simulation_unit_test_set__SimulationUnitTestSet__UserInfo"];
4879
4889
  updated_by: components["schemas"]["amigo_lib__mongo__collections__simulation_unit_test_set__SimulationUnitTestSet__UserInfo"];
4880
4890
  };
@@ -5390,7 +5400,7 @@ export interface components {
5390
5400
  * Tags
5391
5401
  * @description The tags of the simulation persona.
5392
5402
  */
5393
- tags: components["schemas"]["amigo_lib__mongo__collections__simulation_unit_test__SimulationUnitTest__Tag"][];
5403
+ tags: components["schemas"]["amigo_lib__mongo__collections__service__Service__Tag"][];
5394
5404
  };
5395
5405
  /** ToolVersionInstance */
5396
5406
  ToolVersionInstance: {
@@ -6045,6 +6055,13 @@ export interface components {
6045
6055
  */
6046
6056
  description?: string | null;
6047
6057
  };
6058
+ /** Tag */
6059
+ amigo_lib__mongo__collections__service__Service__Tag: {
6060
+ /** Key */
6061
+ key: string;
6062
+ /** Value */
6063
+ value: string | null;
6064
+ };
6048
6065
  /**
6049
6066
  * VersionSet
6050
6067
  * @description A version set pins the agent, state machine, and model version used by this service.
@@ -6091,13 +6108,6 @@ export interface components {
6091
6108
  metric_id: string;
6092
6109
  criterion: components["schemas"]["SuccessCriterionDescription-Output"];
6093
6110
  };
6094
- /** Tag */
6095
- amigo_lib__mongo__collections__simulation_unit_test__SimulationUnitTest__Tag: {
6096
- /** Key */
6097
- key: string;
6098
- /** Value */
6099
- value: string | null;
6100
- };
6101
6111
  /** UserInfo */
6102
6112
  amigo_lib__mongo__collections__simulation_unit_test__SimulationUnitTest__UserInfo: {
6103
6113
  /** Org Id */
@@ -6392,6 +6402,23 @@ export interface components {
6392
6402
  engage_user_tool_call_logs: components["schemas"]["ToolCallLog"][][];
6393
6403
  };
6394
6404
  conversation__interact_with_conversation__Response: components["schemas"]["ConversationEvent"] | components["schemas"]["UserMessageAvailableEvent"] | components["schemas"]["ErrorEvent"];
6405
+ /** Request */
6406
+ conversation__recommend_responses_for_interaction__Request: {
6407
+ /**
6408
+ * @description The context under which the recommended responses should be generated.
6409
+ * @default
6410
+ * PERSONA:
6411
+ * Name: User
6412
+ * Background: A typical person seeking this service.
6413
+ * ---
6414
+ * SCENARIO:
6415
+ * Name: Complete Service
6416
+ * Objective: Successfully complete the service interaction.
6417
+ * Instructions: Engage naturally with the agent to achieve the service objective.
6418
+ *
6419
+ */
6420
+ context?: components["schemas"]["amigo_lib__pydantic__base_model__StrippedNonemptyString__1"];
6421
+ };
6395
6422
  /** Response */
6396
6423
  conversation__recommend_responses_for_interaction__Response: {
6397
6424
  /**
@@ -6527,7 +6554,7 @@ export interface components {
6527
6554
  * Dynamic Behavior Sets
6528
6555
  * @description The retrieved dynamic behavior sets.
6529
6556
  */
6530
- dynamic_behavior_sets: components["schemas"]["dynamic_behavior_set__get_dynamic_behavior_sets__Response__DynamicBehaviorSetInstance"][];
6557
+ dynamic_behavior_sets: components["schemas"]["dynamic_behavior_set__search_dynamic_behavior_sets__Response__DynamicBehaviorSetInstance"][];
6531
6558
  /**
6532
6559
  * Has More
6533
6560
  * @description Whether there are more dynamic behavior sets to retrieve.
@@ -6544,8 +6571,34 @@ export interface components {
6544
6571
  * retrieved. */
6545
6572
  filter_values: components["schemas"]["dynamic_behavior_set__get_dynamic_behavior_sets__Response__FilterValues"] | null;
6546
6573
  };
6574
+ /** FilterValues */
6575
+ dynamic_behavior_set__get_dynamic_behavior_sets__Response__FilterValues: {
6576
+ /**
6577
+ * Applied To Services Ids
6578
+ * @description A set of service IDs that have dynamic behavior sets applied to the service.
6579
+ */
6580
+ applied_to_services_ids: string[];
6581
+ /**
6582
+ * Creators
6583
+ * @description A set of creator infos that created the dynamic behavior sets under the current filters.
6584
+ */
6585
+ creators: components["schemas"]["amigo_lib__mongo__collections__dynamic_behavior_set__DynamicBehaviorSet__UserInfo"][];
6586
+ /**
6587
+ * Tags
6588
+ * @description A set of tag keys that exist in the dynamic behavior sets under the current filters.
6589
+ */
6590
+ tags: string[];
6591
+ };
6592
+ /** Response */
6593
+ dynamic_behavior_set__search_dynamic_behavior_sets__Response: {
6594
+ /**
6595
+ * Dynamic Behavior Sets
6596
+ * @description The retrieved dynamic behavior sets.
6597
+ */
6598
+ dynamic_behavior_sets: components["schemas"]["dynamic_behavior_set__search_dynamic_behavior_sets__Response__DynamicBehaviorSetInstance"][];
6599
+ };
6547
6600
  /** DynamicBehaviorSetInstance */
6548
- dynamic_behavior_set__get_dynamic_behavior_sets__Response__DynamicBehaviorSetInstance: {
6601
+ dynamic_behavior_set__search_dynamic_behavior_sets__Response__DynamicBehaviorSetInstance: {
6549
6602
  /** Id */
6550
6603
  id: string;
6551
6604
  /** Name */
@@ -6571,32 +6624,6 @@ export interface components {
6571
6624
  updated_at: string;
6572
6625
  updated_by: components["schemas"]["amigo_lib__mongo__collections__dynamic_behavior_set__DynamicBehaviorSet__UserInfo"];
6573
6626
  };
6574
- /** FilterValues */
6575
- dynamic_behavior_set__get_dynamic_behavior_sets__Response__FilterValues: {
6576
- /**
6577
- * Applied To Services Ids
6578
- * @description A set of service IDs that have dynamic behavior sets applied to the service.
6579
- */
6580
- applied_to_services_ids: string[];
6581
- /**
6582
- * Creators
6583
- * @description A set of creator infos that created the dynamic behavior sets under the current filters.
6584
- */
6585
- creators: components["schemas"]["amigo_lib__mongo__collections__dynamic_behavior_set__DynamicBehaviorSet__UserInfo"][];
6586
- /**
6587
- * Tags
6588
- * @description A set of tag keys that exist in the dynamic behavior sets under the current filters.
6589
- */
6590
- tags: string[];
6591
- };
6592
- /** Response */
6593
- dynamic_behavior_set__search_dynamic_behavior_sets__Response: {
6594
- /**
6595
- * Dynamic Behavior Sets
6596
- * @description The retrieved dynamic behavior sets.
6597
- */
6598
- dynamic_behavior_sets: components["schemas"]["dynamic_behavior_set__get_dynamic_behavior_sets__Response__DynamicBehaviorSetInstance"][];
6599
- };
6600
6627
  /** Request */
6601
6628
  dynamic_behavior_set__update_dynamic_behavior_set__Request: {
6602
6629
  /** @description The name of the dynamic behavior set. */
@@ -6921,7 +6948,7 @@ export interface components {
6921
6948
  * User Dimensions
6922
6949
  * @description User dimensions for the organization.
6923
6950
  */
6924
- user_dimensions: components["schemas"]["organization__create_organization__Request__UserDimension"][];
6951
+ user_dimensions: components["schemas"]["organization__modify_organization__Request__UserDimension"][];
6925
6952
  /**
6926
6953
  * Logo
6927
6954
  * Format: base64
@@ -6991,12 +7018,6 @@ export interface components {
6991
7018
  /** Timezone */
6992
7019
  timezone?: ("Africa/Abidjan" | "Africa/Accra" | "Africa/Addis_Ababa" | "Africa/Algiers" | "Africa/Asmara" | "Africa/Asmera" | "Africa/Bamako" | "Africa/Bangui" | "Africa/Banjul" | "Africa/Bissau" | "Africa/Blantyre" | "Africa/Brazzaville" | "Africa/Bujumbura" | "Africa/Cairo" | "Africa/Casablanca" | "Africa/Ceuta" | "Africa/Conakry" | "Africa/Dakar" | "Africa/Dar_es_Salaam" | "Africa/Djibouti" | "Africa/Douala" | "Africa/El_Aaiun" | "Africa/Freetown" | "Africa/Gaborone" | "Africa/Harare" | "Africa/Johannesburg" | "Africa/Juba" | "Africa/Kampala" | "Africa/Khartoum" | "Africa/Kigali" | "Africa/Kinshasa" | "Africa/Lagos" | "Africa/Libreville" | "Africa/Lome" | "Africa/Luanda" | "Africa/Lubumbashi" | "Africa/Lusaka" | "Africa/Malabo" | "Africa/Maputo" | "Africa/Maseru" | "Africa/Mbabane" | "Africa/Mogadishu" | "Africa/Monrovia" | "Africa/Nairobi" | "Africa/Ndjamena" | "Africa/Niamey" | "Africa/Nouakchott" | "Africa/Ouagadougou" | "Africa/Porto-Novo" | "Africa/Sao_Tome" | "Africa/Timbuktu" | "Africa/Tripoli" | "Africa/Tunis" | "Africa/Windhoek" | "America/Adak" | "America/Anchorage" | "America/Anguilla" | "America/Antigua" | "America/Araguaina" | "America/Argentina/Buenos_Aires" | "America/Argentina/Catamarca" | "America/Argentina/ComodRivadavia" | "America/Argentina/Cordoba" | "America/Argentina/Jujuy" | "America/Argentina/La_Rioja" | "America/Argentina/Mendoza" | "America/Argentina/Rio_Gallegos" | "America/Argentina/Salta" | "America/Argentina/San_Juan" | "America/Argentina/San_Luis" | "America/Argentina/Tucuman" | "America/Argentina/Ushuaia" | "America/Aruba" | "America/Asuncion" | "America/Atikokan" | "America/Atka" | "America/Bahia" | "America/Bahia_Banderas" | "America/Barbados" | "America/Belem" | "America/Belize" | "America/Blanc-Sablon" | "America/Boa_Vista" | "America/Bogota" | "America/Boise" | "America/Buenos_Aires" | "America/Cambridge_Bay" | "America/Campo_Grande" | "America/Cancun" | "America/Caracas" | "America/Catamarca" | "America/Cayenne" | "America/Cayman" | "America/Chicago" | "America/Chihuahua" | "America/Ciudad_Juarez" | "America/Coral_Harbour" | "America/Cordoba" | "America/Costa_Rica" | "America/Coyhaique" | "America/Creston" | "America/Cuiaba" | "America/Curacao" | "America/Danmarkshavn" | "America/Dawson" | "America/Dawson_Creek" | "America/Denver" | "America/Detroit" | "America/Dominica" | "America/Edmonton" | "America/Eirunepe" | "America/El_Salvador" | "America/Ensenada" | "America/Fort_Nelson" | "America/Fort_Wayne" | "America/Fortaleza" | "America/Glace_Bay" | "America/Godthab" | "America/Goose_Bay" | "America/Grand_Turk" | "America/Grenada" | "America/Guadeloupe" | "America/Guatemala" | "America/Guayaquil" | "America/Guyana" | "America/Halifax" | "America/Havana" | "America/Hermosillo" | "America/Indiana/Indianapolis" | "America/Indiana/Knox" | "America/Indiana/Marengo" | "America/Indiana/Petersburg" | "America/Indiana/Tell_City" | "America/Indiana/Vevay" | "America/Indiana/Vincennes" | "America/Indiana/Winamac" | "America/Indianapolis" | "America/Inuvik" | "America/Iqaluit" | "America/Jamaica" | "America/Jujuy" | "America/Juneau" | "America/Kentucky/Louisville" | "America/Kentucky/Monticello" | "America/Knox_IN" | "America/Kralendijk" | "America/La_Paz" | "America/Lima" | "America/Los_Angeles" | "America/Louisville" | "America/Lower_Princes" | "America/Maceio" | "America/Managua" | "America/Manaus" | "America/Marigot" | "America/Martinique" | "America/Matamoros" | "America/Mazatlan" | "America/Mendoza" | "America/Menominee" | "America/Merida" | "America/Metlakatla" | "America/Mexico_City" | "America/Miquelon" | "America/Moncton" | "America/Monterrey" | "America/Montevideo" | "America/Montreal" | "America/Montserrat" | "America/Nassau" | "America/New_York" | "America/Nipigon" | "America/Nome" | "America/Noronha" | "America/North_Dakota/Beulah" | "America/North_Dakota/Center" | "America/North_Dakota/New_Salem" | "America/Nuuk" | "America/Ojinaga" | "America/Panama" | "America/Pangnirtung" | "America/Paramaribo" | "America/Phoenix" | "America/Port-au-Prince" | "America/Port_of_Spain" | "America/Porto_Acre" | "America/Porto_Velho" | "America/Puerto_Rico" | "America/Punta_Arenas" | "America/Rainy_River" | "America/Rankin_Inlet" | "America/Recife" | "America/Regina" | "America/Resolute" | "America/Rio_Branco" | "America/Rosario" | "America/Santa_Isabel" | "America/Santarem" | "America/Santiago" | "America/Santo_Domingo" | "America/Sao_Paulo" | "America/Scoresbysund" | "America/Shiprock" | "America/Sitka" | "America/St_Barthelemy" | "America/St_Johns" | "America/St_Kitts" | "America/St_Lucia" | "America/St_Thomas" | "America/St_Vincent" | "America/Swift_Current" | "America/Tegucigalpa" | "America/Thule" | "America/Thunder_Bay" | "America/Tijuana" | "America/Toronto" | "America/Tortola" | "America/Vancouver" | "America/Virgin" | "America/Whitehorse" | "America/Winnipeg" | "America/Yakutat" | "America/Yellowknife" | "Antarctica/Casey" | "Antarctica/Davis" | "Antarctica/DumontDUrville" | "Antarctica/Macquarie" | "Antarctica/Mawson" | "Antarctica/McMurdo" | "Antarctica/Palmer" | "Antarctica/Rothera" | "Antarctica/South_Pole" | "Antarctica/Syowa" | "Antarctica/Troll" | "Antarctica/Vostok" | "Arctic/Longyearbyen" | "Asia/Aden" | "Asia/Almaty" | "Asia/Amman" | "Asia/Anadyr" | "Asia/Aqtau" | "Asia/Aqtobe" | "Asia/Ashgabat" | "Asia/Ashkhabad" | "Asia/Atyrau" | "Asia/Baghdad" | "Asia/Bahrain" | "Asia/Baku" | "Asia/Bangkok" | "Asia/Barnaul" | "Asia/Beirut" | "Asia/Bishkek" | "Asia/Brunei" | "Asia/Calcutta" | "Asia/Chita" | "Asia/Choibalsan" | "Asia/Chongqing" | "Asia/Chungking" | "Asia/Colombo" | "Asia/Dacca" | "Asia/Damascus" | "Asia/Dhaka" | "Asia/Dili" | "Asia/Dubai" | "Asia/Dushanbe" | "Asia/Famagusta" | "Asia/Gaza" | "Asia/Harbin" | "Asia/Hebron" | "Asia/Ho_Chi_Minh" | "Asia/Hong_Kong" | "Asia/Hovd" | "Asia/Irkutsk" | "Asia/Istanbul" | "Asia/Jakarta" | "Asia/Jayapura" | "Asia/Jerusalem" | "Asia/Kabul" | "Asia/Kamchatka" | "Asia/Karachi" | "Asia/Kashgar" | "Asia/Kathmandu" | "Asia/Katmandu" | "Asia/Khandyga" | "Asia/Kolkata" | "Asia/Krasnoyarsk" | "Asia/Kuala_Lumpur" | "Asia/Kuching" | "Asia/Kuwait" | "Asia/Macao" | "Asia/Macau" | "Asia/Magadan" | "Asia/Makassar" | "Asia/Manila" | "Asia/Muscat" | "Asia/Nicosia" | "Asia/Novokuznetsk" | "Asia/Novosibirsk" | "Asia/Omsk" | "Asia/Oral" | "Asia/Phnom_Penh" | "Asia/Pontianak" | "Asia/Pyongyang" | "Asia/Qatar" | "Asia/Qostanay" | "Asia/Qyzylorda" | "Asia/Rangoon" | "Asia/Riyadh" | "Asia/Saigon" | "Asia/Sakhalin" | "Asia/Samarkand" | "Asia/Seoul" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Srednekolymsk" | "Asia/Taipei" | "Asia/Tashkent" | "Asia/Tbilisi" | "Asia/Tehran" | "Asia/Tel_Aviv" | "Asia/Thimbu" | "Asia/Thimphu" | "Asia/Tokyo" | "Asia/Tomsk" | "Asia/Ujung_Pandang" | "Asia/Ulaanbaatar" | "Asia/Ulan_Bator" | "Asia/Urumqi" | "Asia/Ust-Nera" | "Asia/Vientiane" | "Asia/Vladivostok" | "Asia/Yakutsk" | "Asia/Yangon" | "Asia/Yekaterinburg" | "Asia/Yerevan" | "Atlantic/Azores" | "Atlantic/Bermuda" | "Atlantic/Canary" | "Atlantic/Cape_Verde" | "Atlantic/Faeroe" | "Atlantic/Faroe" | "Atlantic/Jan_Mayen" | "Atlantic/Madeira" | "Atlantic/Reykjavik" | "Atlantic/South_Georgia" | "Atlantic/St_Helena" | "Atlantic/Stanley" | "Australia/ACT" | "Australia/Adelaide" | "Australia/Brisbane" | "Australia/Broken_Hill" | "Australia/Canberra" | "Australia/Currie" | "Australia/Darwin" | "Australia/Eucla" | "Australia/Hobart" | "Australia/LHI" | "Australia/Lindeman" | "Australia/Lord_Howe" | "Australia/Melbourne" | "Australia/NSW" | "Australia/North" | "Australia/Perth" | "Australia/Queensland" | "Australia/South" | "Australia/Sydney" | "Australia/Tasmania" | "Australia/Victoria" | "Australia/West" | "Australia/Yancowinna" | "Brazil/Acre" | "Brazil/DeNoronha" | "Brazil/East" | "Brazil/West" | "CET" | "CST6CDT" | "Canada/Atlantic" | "Canada/Central" | "Canada/Eastern" | "Canada/Mountain" | "Canada/Newfoundland" | "Canada/Pacific" | "Canada/Saskatchewan" | "Canada/Yukon" | "Chile/Continental" | "Chile/EasterIsland" | "Cuba" | "EET" | "EST" | "EST5EDT" | "Egypt" | "Eire" | "Etc/GMT" | "Etc/GMT+0" | "Etc/GMT+1" | "Etc/GMT+10" | "Etc/GMT+11" | "Etc/GMT+12" | "Etc/GMT+2" | "Etc/GMT+3" | "Etc/GMT+4" | "Etc/GMT+5" | "Etc/GMT+6" | "Etc/GMT+7" | "Etc/GMT+8" | "Etc/GMT+9" | "Etc/GMT-0" | "Etc/GMT-1" | "Etc/GMT-10" | "Etc/GMT-11" | "Etc/GMT-12" | "Etc/GMT-13" | "Etc/GMT-14" | "Etc/GMT-2" | "Etc/GMT-3" | "Etc/GMT-4" | "Etc/GMT-5" | "Etc/GMT-6" | "Etc/GMT-7" | "Etc/GMT-8" | "Etc/GMT-9" | "Etc/GMT0" | "Etc/Greenwich" | "Etc/UCT" | "Etc/UTC" | "Etc/Universal" | "Etc/Zulu" | "Europe/Amsterdam" | "Europe/Andorra" | "Europe/Astrakhan" | "Europe/Athens" | "Europe/Belfast" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Bratislava" | "Europe/Brussels" | "Europe/Bucharest" | "Europe/Budapest" | "Europe/Busingen" | "Europe/Chisinau" | "Europe/Copenhagen" | "Europe/Dublin" | "Europe/Gibraltar" | "Europe/Guernsey" | "Europe/Helsinki" | "Europe/Isle_of_Man" | "Europe/Istanbul" | "Europe/Jersey" | "Europe/Kaliningrad" | "Europe/Kiev" | "Europe/Kirov" | "Europe/Kyiv" | "Europe/Lisbon" | "Europe/Ljubljana" | "Europe/London" | "Europe/Luxembourg" | "Europe/Madrid" | "Europe/Malta" | "Europe/Mariehamn" | "Europe/Minsk" | "Europe/Monaco" | "Europe/Moscow" | "Europe/Nicosia" | "Europe/Oslo" | "Europe/Paris" | "Europe/Podgorica" | "Europe/Prague" | "Europe/Riga" | "Europe/Rome" | "Europe/Samara" | "Europe/San_Marino" | "Europe/Sarajevo" | "Europe/Saratov" | "Europe/Simferopol" | "Europe/Skopje" | "Europe/Sofia" | "Europe/Stockholm" | "Europe/Tallinn" | "Europe/Tirane" | "Europe/Tiraspol" | "Europe/Ulyanovsk" | "Europe/Uzhgorod" | "Europe/Vaduz" | "Europe/Vatican" | "Europe/Vienna" | "Europe/Vilnius" | "Europe/Volgograd" | "Europe/Warsaw" | "Europe/Zagreb" | "Europe/Zaporozhye" | "Europe/Zurich" | "Factory" | "GB" | "GB-Eire" | "GMT" | "GMT+0" | "GMT-0" | "GMT0" | "Greenwich" | "HST" | "Hongkong" | "Iceland" | "Indian/Antananarivo" | "Indian/Chagos" | "Indian/Christmas" | "Indian/Cocos" | "Indian/Comoro" | "Indian/Kerguelen" | "Indian/Mahe" | "Indian/Maldives" | "Indian/Mauritius" | "Indian/Mayotte" | "Indian/Reunion" | "Iran" | "Israel" | "Jamaica" | "Japan" | "Kwajalein" | "Libya" | "MET" | "MST" | "MST7MDT" | "Mexico/BajaNorte" | "Mexico/BajaSur" | "Mexico/General" | "NZ" | "NZ-CHAT" | "Navajo" | "PRC" | "PST8PDT" | "Pacific/Apia" | "Pacific/Auckland" | "Pacific/Bougainville" | "Pacific/Chatham" | "Pacific/Chuuk" | "Pacific/Easter" | "Pacific/Efate" | "Pacific/Enderbury" | "Pacific/Fakaofo" | "Pacific/Fiji" | "Pacific/Funafuti" | "Pacific/Galapagos" | "Pacific/Gambier" | "Pacific/Guadalcanal" | "Pacific/Guam" | "Pacific/Honolulu" | "Pacific/Johnston" | "Pacific/Kanton" | "Pacific/Kiritimati" | "Pacific/Kosrae" | "Pacific/Kwajalein" | "Pacific/Majuro" | "Pacific/Marquesas" | "Pacific/Midway" | "Pacific/Nauru" | "Pacific/Niue" | "Pacific/Norfolk" | "Pacific/Noumea" | "Pacific/Pago_Pago" | "Pacific/Palau" | "Pacific/Pitcairn" | "Pacific/Pohnpei" | "Pacific/Ponape" | "Pacific/Port_Moresby" | "Pacific/Rarotonga" | "Pacific/Saipan" | "Pacific/Samoa" | "Pacific/Tahiti" | "Pacific/Tarawa" | "Pacific/Tongatapu" | "Pacific/Truk" | "Pacific/Wake" | "Pacific/Wallis" | "Pacific/Yap" | "Poland" | "Portugal" | "ROC" | "ROK" | "Singapore" | "Turkey" | "UCT" | "US/Alaska" | "US/Aleutian" | "US/Arizona" | "US/Central" | "US/East-Indiana" | "US/Eastern" | "US/Hawaii" | "US/Indiana-Starke" | "US/Michigan" | "US/Mountain" | "US/Pacific" | "US/Samoa" | "UTC" | "Universal" | "W-SU" | "WET" | "Zulu" | "localtime") | null;
6993
7020
  };
6994
- /** UserDimension */
6995
- organization__create_organization__Request__UserDimension: {
6996
- description: components["schemas"]["amigo_lib__pydantic__base_model__StrippedNonemptyString__1"];
6997
- /** Tags */
6998
- tags: components["schemas"]["amigo_lib__pydantic__base_model__StrippedNonemptyString__1"][];
6999
- };
7000
7021
  /** Response */
7001
7022
  organization__create_organization__Response: {
7002
7023
  /**
@@ -7348,7 +7369,7 @@ export interface components {
7348
7369
  * User Dimensions
7349
7370
  * @description User dimensions for the organization. If not set or `null`, this field is not updated.
7350
7371
  */
7351
- user_dimensions?: components["schemas"]["organization__create_organization__Request__UserDimension"][] | null;
7372
+ user_dimensions?: components["schemas"]["organization__modify_organization__Request__UserDimension"][] | null;
7352
7373
  /** @description The default user preferences for the organization. If `null`, this field is not updated. */
7353
7374
  default_user_preferences?: components["schemas"]["organization__modify_organization__Request__Preferences"] | null;
7354
7375
  /**
@@ -7382,6 +7403,12 @@ export interface components {
7382
7403
  /** Timezone */
7383
7404
  timezone?: ("Africa/Abidjan" | "Africa/Accra" | "Africa/Addis_Ababa" | "Africa/Algiers" | "Africa/Asmara" | "Africa/Asmera" | "Africa/Bamako" | "Africa/Bangui" | "Africa/Banjul" | "Africa/Bissau" | "Africa/Blantyre" | "Africa/Brazzaville" | "Africa/Bujumbura" | "Africa/Cairo" | "Africa/Casablanca" | "Africa/Ceuta" | "Africa/Conakry" | "Africa/Dakar" | "Africa/Dar_es_Salaam" | "Africa/Djibouti" | "Africa/Douala" | "Africa/El_Aaiun" | "Africa/Freetown" | "Africa/Gaborone" | "Africa/Harare" | "Africa/Johannesburg" | "Africa/Juba" | "Africa/Kampala" | "Africa/Khartoum" | "Africa/Kigali" | "Africa/Kinshasa" | "Africa/Lagos" | "Africa/Libreville" | "Africa/Lome" | "Africa/Luanda" | "Africa/Lubumbashi" | "Africa/Lusaka" | "Africa/Malabo" | "Africa/Maputo" | "Africa/Maseru" | "Africa/Mbabane" | "Africa/Mogadishu" | "Africa/Monrovia" | "Africa/Nairobi" | "Africa/Ndjamena" | "Africa/Niamey" | "Africa/Nouakchott" | "Africa/Ouagadougou" | "Africa/Porto-Novo" | "Africa/Sao_Tome" | "Africa/Timbuktu" | "Africa/Tripoli" | "Africa/Tunis" | "Africa/Windhoek" | "America/Adak" | "America/Anchorage" | "America/Anguilla" | "America/Antigua" | "America/Araguaina" | "America/Argentina/Buenos_Aires" | "America/Argentina/Catamarca" | "America/Argentina/ComodRivadavia" | "America/Argentina/Cordoba" | "America/Argentina/Jujuy" | "America/Argentina/La_Rioja" | "America/Argentina/Mendoza" | "America/Argentina/Rio_Gallegos" | "America/Argentina/Salta" | "America/Argentina/San_Juan" | "America/Argentina/San_Luis" | "America/Argentina/Tucuman" | "America/Argentina/Ushuaia" | "America/Aruba" | "America/Asuncion" | "America/Atikokan" | "America/Atka" | "America/Bahia" | "America/Bahia_Banderas" | "America/Barbados" | "America/Belem" | "America/Belize" | "America/Blanc-Sablon" | "America/Boa_Vista" | "America/Bogota" | "America/Boise" | "America/Buenos_Aires" | "America/Cambridge_Bay" | "America/Campo_Grande" | "America/Cancun" | "America/Caracas" | "America/Catamarca" | "America/Cayenne" | "America/Cayman" | "America/Chicago" | "America/Chihuahua" | "America/Ciudad_Juarez" | "America/Coral_Harbour" | "America/Cordoba" | "America/Costa_Rica" | "America/Coyhaique" | "America/Creston" | "America/Cuiaba" | "America/Curacao" | "America/Danmarkshavn" | "America/Dawson" | "America/Dawson_Creek" | "America/Denver" | "America/Detroit" | "America/Dominica" | "America/Edmonton" | "America/Eirunepe" | "America/El_Salvador" | "America/Ensenada" | "America/Fort_Nelson" | "America/Fort_Wayne" | "America/Fortaleza" | "America/Glace_Bay" | "America/Godthab" | "America/Goose_Bay" | "America/Grand_Turk" | "America/Grenada" | "America/Guadeloupe" | "America/Guatemala" | "America/Guayaquil" | "America/Guyana" | "America/Halifax" | "America/Havana" | "America/Hermosillo" | "America/Indiana/Indianapolis" | "America/Indiana/Knox" | "America/Indiana/Marengo" | "America/Indiana/Petersburg" | "America/Indiana/Tell_City" | "America/Indiana/Vevay" | "America/Indiana/Vincennes" | "America/Indiana/Winamac" | "America/Indianapolis" | "America/Inuvik" | "America/Iqaluit" | "America/Jamaica" | "America/Jujuy" | "America/Juneau" | "America/Kentucky/Louisville" | "America/Kentucky/Monticello" | "America/Knox_IN" | "America/Kralendijk" | "America/La_Paz" | "America/Lima" | "America/Los_Angeles" | "America/Louisville" | "America/Lower_Princes" | "America/Maceio" | "America/Managua" | "America/Manaus" | "America/Marigot" | "America/Martinique" | "America/Matamoros" | "America/Mazatlan" | "America/Mendoza" | "America/Menominee" | "America/Merida" | "America/Metlakatla" | "America/Mexico_City" | "America/Miquelon" | "America/Moncton" | "America/Monterrey" | "America/Montevideo" | "America/Montreal" | "America/Montserrat" | "America/Nassau" | "America/New_York" | "America/Nipigon" | "America/Nome" | "America/Noronha" | "America/North_Dakota/Beulah" | "America/North_Dakota/Center" | "America/North_Dakota/New_Salem" | "America/Nuuk" | "America/Ojinaga" | "America/Panama" | "America/Pangnirtung" | "America/Paramaribo" | "America/Phoenix" | "America/Port-au-Prince" | "America/Port_of_Spain" | "America/Porto_Acre" | "America/Porto_Velho" | "America/Puerto_Rico" | "America/Punta_Arenas" | "America/Rainy_River" | "America/Rankin_Inlet" | "America/Recife" | "America/Regina" | "America/Resolute" | "America/Rio_Branco" | "America/Rosario" | "America/Santa_Isabel" | "America/Santarem" | "America/Santiago" | "America/Santo_Domingo" | "America/Sao_Paulo" | "America/Scoresbysund" | "America/Shiprock" | "America/Sitka" | "America/St_Barthelemy" | "America/St_Johns" | "America/St_Kitts" | "America/St_Lucia" | "America/St_Thomas" | "America/St_Vincent" | "America/Swift_Current" | "America/Tegucigalpa" | "America/Thule" | "America/Thunder_Bay" | "America/Tijuana" | "America/Toronto" | "America/Tortola" | "America/Vancouver" | "America/Virgin" | "America/Whitehorse" | "America/Winnipeg" | "America/Yakutat" | "America/Yellowknife" | "Antarctica/Casey" | "Antarctica/Davis" | "Antarctica/DumontDUrville" | "Antarctica/Macquarie" | "Antarctica/Mawson" | "Antarctica/McMurdo" | "Antarctica/Palmer" | "Antarctica/Rothera" | "Antarctica/South_Pole" | "Antarctica/Syowa" | "Antarctica/Troll" | "Antarctica/Vostok" | "Arctic/Longyearbyen" | "Asia/Aden" | "Asia/Almaty" | "Asia/Amman" | "Asia/Anadyr" | "Asia/Aqtau" | "Asia/Aqtobe" | "Asia/Ashgabat" | "Asia/Ashkhabad" | "Asia/Atyrau" | "Asia/Baghdad" | "Asia/Bahrain" | "Asia/Baku" | "Asia/Bangkok" | "Asia/Barnaul" | "Asia/Beirut" | "Asia/Bishkek" | "Asia/Brunei" | "Asia/Calcutta" | "Asia/Chita" | "Asia/Choibalsan" | "Asia/Chongqing" | "Asia/Chungking" | "Asia/Colombo" | "Asia/Dacca" | "Asia/Damascus" | "Asia/Dhaka" | "Asia/Dili" | "Asia/Dubai" | "Asia/Dushanbe" | "Asia/Famagusta" | "Asia/Gaza" | "Asia/Harbin" | "Asia/Hebron" | "Asia/Ho_Chi_Minh" | "Asia/Hong_Kong" | "Asia/Hovd" | "Asia/Irkutsk" | "Asia/Istanbul" | "Asia/Jakarta" | "Asia/Jayapura" | "Asia/Jerusalem" | "Asia/Kabul" | "Asia/Kamchatka" | "Asia/Karachi" | "Asia/Kashgar" | "Asia/Kathmandu" | "Asia/Katmandu" | "Asia/Khandyga" | "Asia/Kolkata" | "Asia/Krasnoyarsk" | "Asia/Kuala_Lumpur" | "Asia/Kuching" | "Asia/Kuwait" | "Asia/Macao" | "Asia/Macau" | "Asia/Magadan" | "Asia/Makassar" | "Asia/Manila" | "Asia/Muscat" | "Asia/Nicosia" | "Asia/Novokuznetsk" | "Asia/Novosibirsk" | "Asia/Omsk" | "Asia/Oral" | "Asia/Phnom_Penh" | "Asia/Pontianak" | "Asia/Pyongyang" | "Asia/Qatar" | "Asia/Qostanay" | "Asia/Qyzylorda" | "Asia/Rangoon" | "Asia/Riyadh" | "Asia/Saigon" | "Asia/Sakhalin" | "Asia/Samarkand" | "Asia/Seoul" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Srednekolymsk" | "Asia/Taipei" | "Asia/Tashkent" | "Asia/Tbilisi" | "Asia/Tehran" | "Asia/Tel_Aviv" | "Asia/Thimbu" | "Asia/Thimphu" | "Asia/Tokyo" | "Asia/Tomsk" | "Asia/Ujung_Pandang" | "Asia/Ulaanbaatar" | "Asia/Ulan_Bator" | "Asia/Urumqi" | "Asia/Ust-Nera" | "Asia/Vientiane" | "Asia/Vladivostok" | "Asia/Yakutsk" | "Asia/Yangon" | "Asia/Yekaterinburg" | "Asia/Yerevan" | "Atlantic/Azores" | "Atlantic/Bermuda" | "Atlantic/Canary" | "Atlantic/Cape_Verde" | "Atlantic/Faeroe" | "Atlantic/Faroe" | "Atlantic/Jan_Mayen" | "Atlantic/Madeira" | "Atlantic/Reykjavik" | "Atlantic/South_Georgia" | "Atlantic/St_Helena" | "Atlantic/Stanley" | "Australia/ACT" | "Australia/Adelaide" | "Australia/Brisbane" | "Australia/Broken_Hill" | "Australia/Canberra" | "Australia/Currie" | "Australia/Darwin" | "Australia/Eucla" | "Australia/Hobart" | "Australia/LHI" | "Australia/Lindeman" | "Australia/Lord_Howe" | "Australia/Melbourne" | "Australia/NSW" | "Australia/North" | "Australia/Perth" | "Australia/Queensland" | "Australia/South" | "Australia/Sydney" | "Australia/Tasmania" | "Australia/Victoria" | "Australia/West" | "Australia/Yancowinna" | "Brazil/Acre" | "Brazil/DeNoronha" | "Brazil/East" | "Brazil/West" | "CET" | "CST6CDT" | "Canada/Atlantic" | "Canada/Central" | "Canada/Eastern" | "Canada/Mountain" | "Canada/Newfoundland" | "Canada/Pacific" | "Canada/Saskatchewan" | "Canada/Yukon" | "Chile/Continental" | "Chile/EasterIsland" | "Cuba" | "EET" | "EST" | "EST5EDT" | "Egypt" | "Eire" | "Etc/GMT" | "Etc/GMT+0" | "Etc/GMT+1" | "Etc/GMT+10" | "Etc/GMT+11" | "Etc/GMT+12" | "Etc/GMT+2" | "Etc/GMT+3" | "Etc/GMT+4" | "Etc/GMT+5" | "Etc/GMT+6" | "Etc/GMT+7" | "Etc/GMT+8" | "Etc/GMT+9" | "Etc/GMT-0" | "Etc/GMT-1" | "Etc/GMT-10" | "Etc/GMT-11" | "Etc/GMT-12" | "Etc/GMT-13" | "Etc/GMT-14" | "Etc/GMT-2" | "Etc/GMT-3" | "Etc/GMT-4" | "Etc/GMT-5" | "Etc/GMT-6" | "Etc/GMT-7" | "Etc/GMT-8" | "Etc/GMT-9" | "Etc/GMT0" | "Etc/Greenwich" | "Etc/UCT" | "Etc/UTC" | "Etc/Universal" | "Etc/Zulu" | "Europe/Amsterdam" | "Europe/Andorra" | "Europe/Astrakhan" | "Europe/Athens" | "Europe/Belfast" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Bratislava" | "Europe/Brussels" | "Europe/Bucharest" | "Europe/Budapest" | "Europe/Busingen" | "Europe/Chisinau" | "Europe/Copenhagen" | "Europe/Dublin" | "Europe/Gibraltar" | "Europe/Guernsey" | "Europe/Helsinki" | "Europe/Isle_of_Man" | "Europe/Istanbul" | "Europe/Jersey" | "Europe/Kaliningrad" | "Europe/Kiev" | "Europe/Kirov" | "Europe/Kyiv" | "Europe/Lisbon" | "Europe/Ljubljana" | "Europe/London" | "Europe/Luxembourg" | "Europe/Madrid" | "Europe/Malta" | "Europe/Mariehamn" | "Europe/Minsk" | "Europe/Monaco" | "Europe/Moscow" | "Europe/Nicosia" | "Europe/Oslo" | "Europe/Paris" | "Europe/Podgorica" | "Europe/Prague" | "Europe/Riga" | "Europe/Rome" | "Europe/Samara" | "Europe/San_Marino" | "Europe/Sarajevo" | "Europe/Saratov" | "Europe/Simferopol" | "Europe/Skopje" | "Europe/Sofia" | "Europe/Stockholm" | "Europe/Tallinn" | "Europe/Tirane" | "Europe/Tiraspol" | "Europe/Ulyanovsk" | "Europe/Uzhgorod" | "Europe/Vaduz" | "Europe/Vatican" | "Europe/Vienna" | "Europe/Vilnius" | "Europe/Volgograd" | "Europe/Warsaw" | "Europe/Zagreb" | "Europe/Zaporozhye" | "Europe/Zurich" | "Factory" | "GB" | "GB-Eire" | "GMT" | "GMT+0" | "GMT-0" | "GMT0" | "Greenwich" | "HST" | "Hongkong" | "Iceland" | "Indian/Antananarivo" | "Indian/Chagos" | "Indian/Christmas" | "Indian/Cocos" | "Indian/Comoro" | "Indian/Kerguelen" | "Indian/Mahe" | "Indian/Maldives" | "Indian/Mauritius" | "Indian/Mayotte" | "Indian/Reunion" | "Iran" | "Israel" | "Jamaica" | "Japan" | "Kwajalein" | "Libya" | "MET" | "MST" | "MST7MDT" | "Mexico/BajaNorte" | "Mexico/BajaSur" | "Mexico/General" | "NZ" | "NZ-CHAT" | "Navajo" | "PRC" | "PST8PDT" | "Pacific/Apia" | "Pacific/Auckland" | "Pacific/Bougainville" | "Pacific/Chatham" | "Pacific/Chuuk" | "Pacific/Easter" | "Pacific/Efate" | "Pacific/Enderbury" | "Pacific/Fakaofo" | "Pacific/Fiji" | "Pacific/Funafuti" | "Pacific/Galapagos" | "Pacific/Gambier" | "Pacific/Guadalcanal" | "Pacific/Guam" | "Pacific/Honolulu" | "Pacific/Johnston" | "Pacific/Kanton" | "Pacific/Kiritimati" | "Pacific/Kosrae" | "Pacific/Kwajalein" | "Pacific/Majuro" | "Pacific/Marquesas" | "Pacific/Midway" | "Pacific/Nauru" | "Pacific/Niue" | "Pacific/Norfolk" | "Pacific/Noumea" | "Pacific/Pago_Pago" | "Pacific/Palau" | "Pacific/Pitcairn" | "Pacific/Pohnpei" | "Pacific/Ponape" | "Pacific/Port_Moresby" | "Pacific/Rarotonga" | "Pacific/Saipan" | "Pacific/Samoa" | "Pacific/Tahiti" | "Pacific/Tarawa" | "Pacific/Tongatapu" | "Pacific/Truk" | "Pacific/Wake" | "Pacific/Wallis" | "Pacific/Yap" | "Poland" | "Portugal" | "ROC" | "ROK" | "Singapore" | "Turkey" | "UCT" | "US/Alaska" | "US/Aleutian" | "US/Arizona" | "US/Central" | "US/East-Indiana" | "US/Eastern" | "US/Hawaii" | "US/Indiana-Starke" | "US/Michigan" | "US/Mountain" | "US/Pacific" | "US/Samoa" | "UTC" | "Universal" | "W-SU" | "WET" | "Zulu" | "localtime") | null;
7384
7405
  };
7406
+ /** UserDimension */
7407
+ organization__modify_organization__Request__UserDimension: {
7408
+ description: components["schemas"]["amigo_lib__pydantic__base_model__StrippedNonemptyString__1"];
7409
+ /** Tags */
7410
+ tags: components["schemas"]["amigo_lib__pydantic__base_model__StrippedNonemptyString__1"][];
7411
+ };
7385
7412
  /** Request */
7386
7413
  role__assign_role__Request: {
7387
7414
  /**
@@ -7408,7 +7435,7 @@ export interface components {
7408
7435
  * Permission Grants
7409
7436
  * @description A list of permission grants associated with this role.
7410
7437
  */
7411
- permission_grants: components["schemas"]["role__modify_role__Request__PermissionGrant"][];
7438
+ permission_grants: components["schemas"]["role__create_role__Request__PermissionGrant"][];
7412
7439
  /** @description The frontend view for users of this role. */
7413
7440
  frontend_view: components["schemas"]["FrontendView"];
7414
7441
  /**
@@ -7422,6 +7449,25 @@ export interface components {
7422
7449
  */
7423
7450
  inherited_from: string | null;
7424
7451
  };
7452
+ /** PermissionGrant */
7453
+ role__create_role__Request__PermissionGrant: {
7454
+ /**
7455
+ * Action
7456
+ * @description Whether this grant allows or denies the specified access.
7457
+ * @enum {string}
7458
+ */
7459
+ action: "Allow" | "Deny";
7460
+ /** Permission Name */
7461
+ permission_name: string;
7462
+ /**
7463
+ * Conditions
7464
+ * @description A dictionary of attribute name to condition that must be met for this grant to be applicable.
7465
+ */
7466
+ conditions: {
7467
+ [key: string]: components["schemas"]["Condition"];
7468
+ };
7469
+ description?: components["schemas"]["amigo_lib__pydantic__base_model__StrippedNonemptyString__1"] | null;
7470
+ };
7425
7471
  /** Response */
7426
7472
  role__create_role__Response: {
7427
7473
  /**
@@ -7446,7 +7492,7 @@ export interface components {
7446
7492
  * Permission Grants
7447
7493
  * @description A list of permission grants associated with this role. Only updated if specified. This field is an immutable field.
7448
7494
  */
7449
- permission_grants?: components["schemas"]["role__modify_role__Request__PermissionGrant"][] | null;
7495
+ permission_grants?: components["schemas"]["role__create_role__Request__PermissionGrant"][] | null;
7450
7496
  /** @description The frontend view for the user of this role. Only updated if specified. This field is an immutable field. */
7451
7497
  frontend_view?: components["schemas"]["FrontendView"] | null;
7452
7498
  /**
@@ -7456,25 +7502,6 @@ export interface components {
7456
7502
  */
7457
7503
  inherited_from?: string | components["schemas"]["_NotSet"] | null;
7458
7504
  };
7459
- /** PermissionGrant */
7460
- role__modify_role__Request__PermissionGrant: {
7461
- /**
7462
- * Action
7463
- * @description Whether this grant allows or denies the specified access.
7464
- * @enum {string}
7465
- */
7466
- action: "Allow" | "Deny";
7467
- /** Permission Name */
7468
- permission_name: string;
7469
- /**
7470
- * Conditions
7471
- * @description A dictionary of attribute name to condition that must be met for this grant to be applicable.
7472
- */
7473
- conditions: {
7474
- [key: string]: components["schemas"]["Condition"];
7475
- };
7476
- description?: components["schemas"]["amigo_lib__pydantic__base_model__StrippedNonemptyString__1"] | null;
7477
- };
7478
7505
  /** Response */
7479
7506
  role__modify_role__Response: {
7480
7507
  /**
@@ -7529,16 +7556,27 @@ export interface components {
7529
7556
  service_hierarchical_state_machine_version_number: number | null;
7530
7557
  /** Llm Model Preferences */
7531
7558
  llm_model_preferences: {
7532
- [key: string]: components["schemas"]["service__upsert_service_version_set__Request__VersionSet__LLMConfig"] | components["schemas"]["service__create_service__Request__VersionSet__LLMLoadBalancingSetConfig"];
7559
+ [key: string]: components["schemas"]["service__create_service__Request__VersionSet__LLMConfig"] | components["schemas"]["service__upsert_service_version_set__Request__VersionSet__LLMLoadBalancingSetConfig"];
7533
7560
  };
7534
7561
  };
7535
- /** LLMLoadBalancingSetConfig */
7536
- service__create_service__Request__VersionSet__LLMLoadBalancingSetConfig: {
7537
- llm_load_balancing_set_name: components["schemas"]["LLMLoadBalancingSetType"];
7538
- /** Configs */
7539
- configs: {
7540
- [key: string]: components["schemas"]["PerLLMConfig"];
7541
- };
7562
+ /** LLMConfig */
7563
+ service__create_service__Request__VersionSet__LLMConfig: {
7564
+ llm_name: components["schemas"]["LLMType"];
7565
+ /**
7566
+ * Top P
7567
+ * @description The preferred `top_p` value.
7568
+ */
7569
+ top_p: number;
7570
+ /**
7571
+ * Temperature
7572
+ * @description The preferred temperature value.
7573
+ */
7574
+ temperature: number;
7575
+ /**
7576
+ * Top K
7577
+ * @description The preferred `top_k` value. Note that not all LLMs support this.
7578
+ */
7579
+ top_k: number;
7542
7580
  };
7543
7581
  /** Response */
7544
7582
  service__create_service__Response: {
@@ -7617,24 +7655,13 @@ export interface components {
7617
7655
  /** @description The version set to upsert. */
7618
7656
  version_set: components["schemas"]["service__create_service__Request__VersionSet"];
7619
7657
  };
7620
- /** LLMConfig */
7621
- service__upsert_service_version_set__Request__VersionSet__LLMConfig: {
7622
- llm_name: components["schemas"]["LLMType"];
7623
- /**
7624
- * Top P
7625
- * @description The preferred `top_p` value.
7626
- */
7627
- top_p: number;
7628
- /**
7629
- * Temperature
7630
- * @description The preferred temperature value.
7631
- */
7632
- temperature: number;
7633
- /**
7634
- * Top K
7635
- * @description The preferred `top_k` value. Note that not all LLMs support this.
7636
- */
7637
- top_k: number;
7658
+ /** LLMLoadBalancingSetConfig */
7659
+ service__upsert_service_version_set__Request__VersionSet__LLMLoadBalancingSetConfig: {
7660
+ llm_load_balancing_set_name: components["schemas"]["LLMLoadBalancingSetType"];
7661
+ /** Configs */
7662
+ configs: {
7663
+ [key: string]: components["schemas"]["PerLLMConfig"];
7664
+ };
7638
7665
  };
7639
7666
  /** Request */
7640
7667
  simulation__create_simulation_persona__Request: {
@@ -7839,7 +7866,7 @@ export interface components {
7839
7866
  * Unit Test Runs
7840
7867
  * @description The unit test runs that are part of this set.
7841
7868
  */
7842
- unit_test_runs: components["schemas"]["simulation__update_simulation_unit_test_set__Request__UnitTestRunDescriptor"][];
7869
+ unit_test_runs: components["schemas"]["simulation__create_simulation_unit_test_set__Request__UnitTestRunDescriptor"][];
7843
7870
  /**
7844
7871
  * Tags
7845
7872
  * @description The tags of the simulation unit test set.
@@ -7848,6 +7875,16 @@ export interface components {
7848
7875
  [key: string]: string | null;
7849
7876
  };
7850
7877
  };
7878
+ /** UnitTestRunDescriptor */
7879
+ simulation__create_simulation_unit_test_set__Request__UnitTestRunDescriptor: {
7880
+ /** Unit Test Id */
7881
+ unit_test_id: string;
7882
+ /**
7883
+ * Run Count
7884
+ * @description The number of times to run the unit test.
7885
+ */
7886
+ run_count: number;
7887
+ };
7851
7888
  /** Response */
7852
7889
  simulation__create_simulation_unit_test_set__Response: {
7853
7890
  /**
@@ -8344,7 +8381,7 @@ export interface components {
8344
8381
  * Unit Test Runs
8345
8382
  * @description The unit test runs that are part of this set.
8346
8383
  */
8347
- unit_test_runs?: components["schemas"]["simulation__update_simulation_unit_test_set__Request__UnitTestRunDescriptor"][] | null;
8384
+ unit_test_runs?: components["schemas"]["simulation__create_simulation_unit_test_set__Request__UnitTestRunDescriptor"][] | null;
8348
8385
  /**
8349
8386
  * Tags
8350
8387
  * @description The tags of the simulation unit test set.
@@ -8353,16 +8390,6 @@ export interface components {
8353
8390
  [key: string]: string | null;
8354
8391
  } | null;
8355
8392
  };
8356
- /** UnitTestRunDescriptor */
8357
- simulation__update_simulation_unit_test_set__Request__UnitTestRunDescriptor: {
8358
- /** Unit Test Id */
8359
- unit_test_id: string;
8360
- /**
8361
- * Run Count
8362
- * @description The number of times to run the unit test.
8363
- */
8364
- run_count: number;
8365
- };
8366
8393
  /** Request */
8367
8394
  tool__create_tool__Request: {
8368
8395
  /** @description The name of the tool. It must be unique among all non-deprecated tools in the organization. */
@@ -8740,7 +8767,7 @@ export interface components {
8740
8767
  * Users
8741
8768
  * @description Users in this organization.
8742
8769
  */
8743
- users: components["schemas"]["user__search_users__Response__UserInstance"][];
8770
+ users: components["schemas"]["user__get_users__Response__UserInstance"][];
8744
8771
  /**
8745
8772
  * Has More
8746
8773
  * @description Whether there are more users to retrieve.
@@ -8752,34 +8779,8 @@ export interface components {
8752
8779
  */
8753
8780
  continuation_token: number | null;
8754
8781
  };
8755
- /** UserStats */
8756
- user__get_users__Response__UserInstance__UserStats: {
8757
- /**
8758
- * Num Conversations
8759
- * @description The number of conversations the user has created.
8760
- */
8761
- num_conversations: number;
8762
- /**
8763
- * Num Messages
8764
- * @description The number of messages the user has sent and received.
8765
- */
8766
- num_messages: number;
8767
- /**
8768
- * Last Message Time
8769
- * @description The time of the last message the user sent or received. If `None`, the user hasn't started any conversations.
8770
- */
8771
- last_message_time: string | null;
8772
- };
8773
- /** Response */
8774
- user__search_users__Response: {
8775
- /**
8776
- * Users
8777
- * @description Users in this organization.
8778
- */
8779
- users: components["schemas"]["user__search_users__Response__UserInstance"][];
8780
- };
8781
8782
  /** UserInstance */
8782
- user__search_users__Response__UserInstance: {
8783
+ user__get_users__Response__UserInstance: {
8783
8784
  /**
8784
8785
  * Org Id
8785
8786
  * @description The ID of the organization that this user belongs to.
@@ -8815,6 +8816,32 @@ export interface components {
8815
8816
  /** @description The preferences of the user. */
8816
8817
  preferences: components["schemas"]["amigo_lib__mongo__collections__user__User__Preferences"];
8817
8818
  };
8819
+ /** UserStats */
8820
+ user__get_users__Response__UserInstance__UserStats: {
8821
+ /**
8822
+ * Num Conversations
8823
+ * @description The number of conversations the user has created.
8824
+ */
8825
+ num_conversations: number;
8826
+ /**
8827
+ * Num Messages
8828
+ * @description The number of messages the user has sent and received.
8829
+ */
8830
+ num_messages: number;
8831
+ /**
8832
+ * Last Message Time
8833
+ * @description The time of the last message the user sent or received. If `None`, the user hasn't started any conversations.
8834
+ */
8835
+ last_message_time: string | null;
8836
+ };
8837
+ /** Response */
8838
+ user__search_users__Response: {
8839
+ /**
8840
+ * Users
8841
+ * @description Users in this organization.
8842
+ */
8843
+ users: components["schemas"]["user__get_users__Response__UserInstance"][];
8844
+ };
8818
8845
  /** SigninWithAPIKeyResponse */
8819
8846
  user__sign_in_with_api_key__Response: {
8820
8847
  /**
@@ -11201,6 +11228,89 @@ export interface operations {
11201
11228
  };
11202
11229
  };
11203
11230
  };
11231
+ recommend_responses_for_interaction_v1__organization__conversation__conversation_id__interaction__interaction_id__recommend_responses_get: {
11232
+ parameters: {
11233
+ query?: never;
11234
+ header?: {
11235
+ /** @description The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database. */
11236
+ "x-mongo-cluster-name"?: string | null;
11237
+ "Sec-WebSocket-Protocol"?: string[];
11238
+ };
11239
+ path: {
11240
+ /** @description The identifier of the conversation. */
11241
+ conversation_id: string;
11242
+ /** @description The identifier of the most recent interaction. */
11243
+ interaction_id: string;
11244
+ organization: string;
11245
+ };
11246
+ cookie?: never;
11247
+ };
11248
+ requestBody?: {
11249
+ content: {
11250
+ "application/json": components["schemas"]["conversation__recommend_responses_for_interaction__Request"];
11251
+ };
11252
+ };
11253
+ responses: {
11254
+ /** @description Succeeded. */
11255
+ 200: {
11256
+ headers: {
11257
+ [name: string]: unknown;
11258
+ };
11259
+ content: {
11260
+ "application/json": components["schemas"]["conversation__recommend_responses_for_interaction__Response"];
11261
+ };
11262
+ };
11263
+ /** @description The conversation is finished, or the supplied interaction ID doesn't correspond to the latest, completed interaction. */
11264
+ 400: {
11265
+ headers: {
11266
+ [name: string]: unknown;
11267
+ };
11268
+ content?: never;
11269
+ };
11270
+ /** @description Invalid authorization credentials. */
11271
+ 401: {
11272
+ headers: {
11273
+ [name: string]: unknown;
11274
+ };
11275
+ content?: never;
11276
+ };
11277
+ /** @description Missing required permissions. */
11278
+ 403: {
11279
+ headers: {
11280
+ [name: string]: unknown;
11281
+ };
11282
+ content?: never;
11283
+ };
11284
+ /** @description Specified organization or conversation is not found. */
11285
+ 404: {
11286
+ headers: {
11287
+ [name: string]: unknown;
11288
+ };
11289
+ content?: never;
11290
+ };
11291
+ /** @description Invalid request path parameter failed validation. */
11292
+ 422: {
11293
+ headers: {
11294
+ [name: string]: unknown;
11295
+ };
11296
+ content?: never;
11297
+ };
11298
+ /** @description The user has exceeded the rate limit of 20 requests per minute for this endpoint. */
11299
+ 429: {
11300
+ headers: {
11301
+ [name: string]: unknown;
11302
+ };
11303
+ content?: never;
11304
+ };
11305
+ /** @description The service is going through temporary maintenance. */
11306
+ 503: {
11307
+ headers: {
11308
+ [name: string]: unknown;
11309
+ };
11310
+ content?: never;
11311
+ };
11312
+ };
11313
+ };
11204
11314
  "recommend-responses-for-interaction": {
11205
11315
  parameters: {
11206
11316
  query?: never;
@@ -11218,7 +11328,11 @@ export interface operations {
11218
11328
  };
11219
11329
  cookie?: never;
11220
11330
  };
11221
- requestBody?: never;
11331
+ requestBody?: {
11332
+ content: {
11333
+ "application/json": components["schemas"]["conversation__recommend_responses_for_interaction__Request"];
11334
+ };
11335
+ };
11222
11336
  responses: {
11223
11337
  /** @description Succeeded. */
11224
11338
  200: {
@@ -5,7 +5,7 @@ export declare class UserResource {
5
5
  private orgId;
6
6
  constructor(c: AmigoFetch, orgId: string);
7
7
  getUsers(queryParams?: operations['get-users']['parameters']['query'], headers?: operations['get-users']['parameters']['header']): Promise<{
8
- users: components["schemas"]["user__search_users__Response__UserInstance"][];
8
+ users: components["schemas"]["user__get_users__Response__UserInstance"][];
9
9
  has_more: boolean;
10
10
  continuation_token: number | null;
11
11
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amigo-ai/sdk",
3
- "version": "0.50.0",
3
+ "version": "0.51.0",
4
4
  "description": "Amigo TypeScript SDK",
5
5
  "publishConfig": {
6
6
  "access": "public"