import { APIResource } from "../../../core/resource.js"; import * as InstancesAPI from "./instances/instances.js"; import { BaseInstances, InstanceChatCompletionsParams, InstanceChatCompletionsResponse, InstanceCreateParams, InstanceCreateResponse, InstanceDeleteParams, InstanceDeleteResponse, InstanceListParams, InstanceListResponse, InstanceListResponsesV4PagePaginationArray, InstanceReadParams, InstanceReadResponse, InstanceSearchParams, InstanceSearchResponse, InstanceStatsParams, InstanceStatsResponse, InstanceUpdateParams, InstanceUpdateResponse, Instances } from "./instances/instances.js"; import { APIPromise } from "../../../core/api-promise.js"; import { PagePromise, V4PagePaginationArray, type V4PagePaginationArrayParams } from "../../../core/pagination.js"; import { RequestOptions } from "../../../internal/request-options.js"; export declare class BaseNamespaces extends APIResource { static readonly _key: readonly ['aiSearch', 'namespaces']; /** * Create a namespace for organizing AI Search instances. * * @example * ```ts * const namespace = await client.aiSearch.namespaces.create({ * account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22', * name: 'name', * }); * ``` */ create(params: NamespaceCreateParams, options?: RequestOptions): APIPromise; /** * Update the description and/or the public endpoint configuration of an existing * namespace. The default namespace's description cannot be modified, but its * public endpoint can. * * @example * ```ts * const namespace = await client.aiSearch.namespaces.update( * 'production', * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, * ); * ``` */ update(name: string, params: NamespaceUpdateParams, options?: RequestOptions): APIPromise; /** * List namespaces in the account, including their descriptions and creation times. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const namespaceListResponse of client.aiSearch.namespaces.list( * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, * )) { * // ... * } * ``` */ list(params: NamespaceListParams, options?: RequestOptions): PagePromise; /** * Permanently delete a namespace. The namespace must be empty (no instances), and * the default namespace cannot be deleted. * * @example * ```ts * const namespace = await client.aiSearch.namespaces.delete( * 'production', * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, * ); * ``` */ delete(name: string, params: NamespaceDeleteParams, options?: RequestOptions): APIPromise; /** * Performs a chat completion request against multiple AI Search instances in * parallel, merging retrieved content as context for generating a response. * * @example * ```ts * const response = * await client.aiSearch.namespaces.chatCompletions( * 'my-namespace', * { * account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22', * ai_search_options: { instance_ids: ['my-ai-search'] }, * messages: [{ content: 'string', role: 'system' }], * }, * ); * ``` */ chatCompletions(name: string, params: NamespaceChatCompletionsParams, options?: RequestOptions): APIPromise; /** * Retrieve a namespace and its description. * * @example * ```ts * const response = await client.aiSearch.namespaces.read( * 'production', * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, * ); * ``` */ read(name: string, params: NamespaceReadParams, options?: RequestOptions): APIPromise; /** * Performs a semantic search query against multiple AI Search instances in * parallel, merging the retrieved results into a single ranked response. * * @example * ```ts * const response = await client.aiSearch.namespaces.search( * 'my-namespace', * { * account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22', * ai_search_options: { instance_ids: ['my-ai-search'] }, * }, * ); * ``` */ search(name: string, params: NamespaceSearchParams, options?: RequestOptions): APIPromise; } export declare class Namespaces extends BaseNamespaces { instances: InstancesAPI.Instances; } export type NamespaceListResponsesV4PagePaginationArray = V4PagePaginationArray; export interface NamespaceCreateResponse { created_at: string; name: string; /** * Optional description for the namespace. Max 256 characters. */ description?: string | null; public_endpoint_id?: string | null; public_endpoint_params?: NamespaceCreateResponse.PublicEndpointParams | null; } export declare namespace NamespaceCreateResponse { interface PublicEndpointParams { authorized_hosts?: Array; chat_completions_endpoint?: PublicEndpointParams.ChatCompletionsEndpoint; /** * Custom domain hostnames that alias this public endpoint. GET and create * responses return the current set; on update (PUT) this field is only echoed back * when supplied in the request body, otherwise it is null (omit it to leave * domains unchanged). */ custom_domains?: Array | null; /** * When false, the instance is reachable only via a registered custom domain and * the default .search.ai.cloudflare.com host returns 404. * Requires at least one custom domain. Defaults to true. public_endpoint_params is * replaced wholesale on update, so resend default_domain_enabled on every update * to keep the default host off — omitting it resets to true. */ default_domain_enabled?: boolean; enabled?: boolean; /** * Instance IDs exposed through the namespace public endpoint. Empty means nothing * is searchable. Every ID must be an existing instance in this namespace, and the * list cannot exceed the account's multi-instance search limit. */ instances_allowed?: Array; mcp?: PublicEndpointParams.Mcp; rate_limit?: PublicEndpointParams.RateLimit; search_endpoint?: PublicEndpointParams.SearchEndpoint; } namespace PublicEndpointParams { interface ChatCompletionsEndpoint { /** * Disable chat completions endpoint for this public endpoint */ disabled?: boolean; } interface Mcp { description?: string; /** * Disable MCP endpoint for this public endpoint */ disabled?: boolean; } interface RateLimit { period_ms?: number; requests?: number; technique?: 'fixed' | 'sliding'; } interface SearchEndpoint { /** * Disable search endpoint for this public endpoint */ disabled?: boolean; } } } export interface NamespaceUpdateResponse { created_at: string; name: string; /** * Optional description for the namespace. Max 256 characters. */ description?: string | null; public_endpoint_id?: string | null; public_endpoint_params?: NamespaceUpdateResponse.PublicEndpointParams | null; } export declare namespace NamespaceUpdateResponse { interface PublicEndpointParams { authorized_hosts?: Array; chat_completions_endpoint?: PublicEndpointParams.ChatCompletionsEndpoint; /** * Custom domain hostnames that alias this public endpoint. GET and create * responses return the current set; on update (PUT) this field is only echoed back * when supplied in the request body, otherwise it is null (omit it to leave * domains unchanged). */ custom_domains?: Array | null; /** * When false, the instance is reachable only via a registered custom domain and * the default .search.ai.cloudflare.com host returns 404. * Requires at least one custom domain. Defaults to true. public_endpoint_params is * replaced wholesale on update, so resend default_domain_enabled on every update * to keep the default host off — omitting it resets to true. */ default_domain_enabled?: boolean; enabled?: boolean; /** * Instance IDs exposed through the namespace public endpoint. Empty means nothing * is searchable. Every ID must be an existing instance in this namespace, and the * list cannot exceed the account's multi-instance search limit. */ instances_allowed?: Array; mcp?: PublicEndpointParams.Mcp; rate_limit?: PublicEndpointParams.RateLimit; search_endpoint?: PublicEndpointParams.SearchEndpoint; } namespace PublicEndpointParams { interface ChatCompletionsEndpoint { /** * Disable chat completions endpoint for this public endpoint */ disabled?: boolean; } interface Mcp { description?: string; /** * Disable MCP endpoint for this public endpoint */ disabled?: boolean; } interface RateLimit { period_ms?: number; requests?: number; technique?: 'fixed' | 'sliding'; } interface SearchEndpoint { /** * Disable search endpoint for this public endpoint */ disabled?: boolean; } } } export interface NamespaceListResponse { created_at: string; name: string; /** * Optional description for the namespace. Max 256 characters. */ description?: string | null; public_endpoint_id?: string | null; public_endpoint_params?: NamespaceListResponse.PublicEndpointParams | null; } export declare namespace NamespaceListResponse { interface PublicEndpointParams { authorized_hosts?: Array; chat_completions_endpoint?: PublicEndpointParams.ChatCompletionsEndpoint; /** * Custom domain hostnames that alias this public endpoint. GET and create * responses return the current set; on update (PUT) this field is only echoed back * when supplied in the request body, otherwise it is null (omit it to leave * domains unchanged). */ custom_domains?: Array | null; /** * When false, the instance is reachable only via a registered custom domain and * the default .search.ai.cloudflare.com host returns 404. * Requires at least one custom domain. Defaults to true. public_endpoint_params is * replaced wholesale on update, so resend default_domain_enabled on every update * to keep the default host off — omitting it resets to true. */ default_domain_enabled?: boolean; enabled?: boolean; /** * Instance IDs exposed through the namespace public endpoint. Empty means nothing * is searchable. Every ID must be an existing instance in this namespace, and the * list cannot exceed the account's multi-instance search limit. */ instances_allowed?: Array; mcp?: PublicEndpointParams.Mcp; rate_limit?: PublicEndpointParams.RateLimit; search_endpoint?: PublicEndpointParams.SearchEndpoint; } namespace PublicEndpointParams { interface ChatCompletionsEndpoint { /** * Disable chat completions endpoint for this public endpoint */ disabled?: boolean; } interface Mcp { description?: string; /** * Disable MCP endpoint for this public endpoint */ disabled?: boolean; } interface RateLimit { period_ms?: number; requests?: number; technique?: 'fixed' | 'sliding'; } interface SearchEndpoint { /** * Disable search endpoint for this public endpoint */ disabled?: boolean; } } } export type NamespaceDeleteResponse = unknown; export interface NamespaceChatCompletionsResponse { choices: Array; chunks: Array; id?: string; errors?: Array; model?: string; object?: string; [k: string]: unknown; } export declare namespace NamespaceChatCompletionsResponse { interface Choice { message: Choice.Message; index?: number; } namespace Choice { interface Message { content: string | Array | null; role: 'system' | 'developer' | 'user' | 'assistant' | 'tool'; [k: string]: unknown; } namespace Message { interface UnionMember0 { text: string; type: 'text'; } interface UnionMember1 { image_url: UnionMember1.ImageURL; type: 'image_url'; } namespace UnionMember1 { interface ImageURL { url: string; } } interface UnionMember2 { file: UnionMember2.File; type: 'file'; } namespace UnionMember2 { interface File { filename: string; file_data?: string; file_id?: string; } } } } interface Chunk { id: string; instance_id: string; score: number; text: string; type: string; item?: Chunk.Item; scoring_details?: Chunk.ScoringDetails; } namespace Chunk { interface Item { key: string; metadata?: { [key: string]: unknown; }; timestamp?: number; } interface ScoringDetails { fusion_method?: 'rrf' | 'max'; keyword_rank?: number; keyword_score?: number; reranking_score?: number; vector_rank?: number; vector_score?: number; } } interface Error { instance_id: string; message: string; } } export interface NamespaceReadResponse { created_at: string; name: string; /** * Optional description for the namespace. Max 256 characters. */ description?: string | null; public_endpoint_id?: string | null; public_endpoint_params?: NamespaceReadResponse.PublicEndpointParams | null; } export declare namespace NamespaceReadResponse { interface PublicEndpointParams { authorized_hosts?: Array; chat_completions_endpoint?: PublicEndpointParams.ChatCompletionsEndpoint; /** * Custom domain hostnames that alias this public endpoint. GET and create * responses return the current set; on update (PUT) this field is only echoed back * when supplied in the request body, otherwise it is null (omit it to leave * domains unchanged). */ custom_domains?: Array | null; /** * When false, the instance is reachable only via a registered custom domain and * the default .search.ai.cloudflare.com host returns 404. * Requires at least one custom domain. Defaults to true. public_endpoint_params is * replaced wholesale on update, so resend default_domain_enabled on every update * to keep the default host off — omitting it resets to true. */ default_domain_enabled?: boolean; enabled?: boolean; /** * Instance IDs exposed through the namespace public endpoint. Empty means nothing * is searchable. Every ID must be an existing instance in this namespace, and the * list cannot exceed the account's multi-instance search limit. */ instances_allowed?: Array; mcp?: PublicEndpointParams.Mcp; rate_limit?: PublicEndpointParams.RateLimit; search_endpoint?: PublicEndpointParams.SearchEndpoint; } namespace PublicEndpointParams { interface ChatCompletionsEndpoint { /** * Disable chat completions endpoint for this public endpoint */ disabled?: boolean; } interface Mcp { description?: string; /** * Disable MCP endpoint for this public endpoint */ disabled?: boolean; } interface RateLimit { period_ms?: number; requests?: number; technique?: 'fixed' | 'sliding'; } interface SearchEndpoint { /** * Disable search endpoint for this public endpoint */ disabled?: boolean; } } } export interface NamespaceSearchResponse { chunks: Array; query_kind: 'text' | 'image' | 'multimodal'; errors?: Array; search_query?: string; } export declare namespace NamespaceSearchResponse { interface Chunk { id: string; instance_id: string; score: number; text: string; type: string; item?: Chunk.Item; scoring_details?: Chunk.ScoringDetails; } namespace Chunk { interface Item { key: string; metadata?: { [key: string]: unknown; }; timestamp?: number; } interface ScoringDetails { fusion_method?: 'rrf' | 'max'; keyword_rank?: number; keyword_score?: number; reranking_score?: number; vector_rank?: number; vector_score?: number; } } interface Error { instance_id: string; message: string; } } export interface NamespaceCreateParams { /** * Path param */ account_id: string; /** * Body param */ name: string; /** * Body param: Optional description for the namespace. Max 256 characters. */ description?: string | null; /** * Body param */ public_endpoint_params?: NamespaceCreateParams.PublicEndpointParams; } export declare namespace NamespaceCreateParams { interface PublicEndpointParams { authorized_hosts?: Array; chat_completions_endpoint?: PublicEndpointParams.ChatCompletionsEndpoint; /** * Custom domain hostnames that alias this public endpoint. GET and create * responses return the current set; on update (PUT) this field is only echoed back * when supplied in the request body, otherwise it is null (omit it to leave * domains unchanged). */ custom_domains?: Array | null; /** * When false, the instance is reachable only via a registered custom domain and * the default .search.ai.cloudflare.com host returns 404. * Requires at least one custom domain. Defaults to true. public_endpoint_params is * replaced wholesale on update, so resend default_domain_enabled on every update * to keep the default host off — omitting it resets to true. */ default_domain_enabled?: boolean; enabled?: boolean; /** * Instance IDs exposed through the namespace public endpoint. Empty means nothing * is searchable. Every ID must be an existing instance in this namespace, and the * list cannot exceed the account's multi-instance search limit. */ instances_allowed?: Array; mcp?: PublicEndpointParams.Mcp; rate_limit?: PublicEndpointParams.RateLimit; search_endpoint?: PublicEndpointParams.SearchEndpoint; } namespace PublicEndpointParams { interface ChatCompletionsEndpoint { /** * Disable chat completions endpoint for this public endpoint */ disabled?: boolean; } interface Mcp { description?: string; /** * Disable MCP endpoint for this public endpoint */ disabled?: boolean; } interface RateLimit { period_ms?: number; requests?: number; technique?: 'fixed' | 'sliding'; } interface SearchEndpoint { /** * Disable search endpoint for this public endpoint */ disabled?: boolean; } } } export interface NamespaceUpdateParams { /** * Path param */ account_id: string; /** * Body param: Optional description for the namespace. Max 256 characters. */ description?: string | null; /** * Body param */ public_endpoint_params?: NamespaceUpdateParams.PublicEndpointParams | null; } export declare namespace NamespaceUpdateParams { interface PublicEndpointParams { authorized_hosts?: Array; chat_completions_endpoint?: PublicEndpointParams.ChatCompletionsEndpoint; /** * Custom domain hostnames that alias this public endpoint. GET and create * responses return the current set; on update (PUT) this field is only echoed back * when supplied in the request body, otherwise it is null (omit it to leave * domains unchanged). */ custom_domains?: Array | null; /** * When false, the instance is reachable only via a registered custom domain and * the default .search.ai.cloudflare.com host returns 404. * Requires at least one custom domain. Defaults to true. public_endpoint_params is * replaced wholesale on update, so resend default_domain_enabled on every update * to keep the default host off — omitting it resets to true. */ default_domain_enabled?: boolean; enabled?: boolean; /** * Instance IDs exposed through the namespace public endpoint. Empty means nothing * is searchable. Every ID must be an existing instance in this namespace, and the * list cannot exceed the account's multi-instance search limit. */ instances_allowed?: Array; mcp?: PublicEndpointParams.Mcp; rate_limit?: PublicEndpointParams.RateLimit; search_endpoint?: PublicEndpointParams.SearchEndpoint; } namespace PublicEndpointParams { interface ChatCompletionsEndpoint { /** * Disable chat completions endpoint for this public endpoint */ disabled?: boolean; } interface Mcp { description?: string; /** * Disable MCP endpoint for this public endpoint */ disabled?: boolean; } interface RateLimit { period_ms?: number; requests?: number; technique?: 'fixed' | 'sliding'; } interface SearchEndpoint { /** * Disable search endpoint for this public endpoint */ disabled?: boolean; } } } export interface NamespaceListParams extends V4PagePaginationArrayParams { /** * Path param */ account_id: string; /** * Query param: Filter namespaces whose name or description contains this string * (case-insensitive). */ search?: string; } export interface NamespaceDeleteParams { account_id: string; } export interface NamespaceChatCompletionsParams { /** * Path param */ account_id: string; /** * Body param */ ai_search_options: NamespaceChatCompletionsParams.AISearchOptions; /** * Body param */ messages: Array; /** * Body param */ model?: '@cf/meta/llama-3.3-70b-instruct-fp8-fast' | '@cf/zai-org/glm-4.7-flash' | '@cf/meta/llama-3.1-8b-instruct-fast' | '@cf/meta/llama-3.1-8b-instruct-fp8' | '@cf/meta/llama-4-scout-17b-16e-instruct' | '@cf/qwen/qwen3-30b-a3b-fp8' | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' | '@cf/moonshotai/kimi-k2-instruct' | '@cf/google/gemma-3-12b-it' | '@cf/google/gemma-4-26b-a4b-it' | '@cf/moonshotai/kimi-k2.5' | 'anthropic/claude-3-7-sonnet' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-opus-4' | 'anthropic/claude-3-5-haiku' | 'cerebras/qwen-3-235b-a22b-instruct' | 'cerebras/qwen-3-235b-a22b-thinking' | 'cerebras/llama-3.3-70b' | 'cerebras/llama-4-maverick-17b-128e-instruct' | 'cerebras/llama-4-scout-17b-16e-instruct' | 'cerebras/gpt-oss-120b' | 'google-ai-studio/gemini-2.5-flash' | 'google-ai-studio/gemini-2.5-pro' | 'grok/grok-4' | 'groq/llama-3.3-70b-versatile' | 'groq/llama-3.1-8b-instant' | 'openai/gpt-5' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | ''; /** * Body param */ stream?: boolean; [k: string]: unknown; } export declare namespace NamespaceChatCompletionsParams { interface AISearchOptions { instance_ids: Array; cache?: AISearchOptions.Cache; query_rewrite?: AISearchOptions.QueryRewrite; reranking?: AISearchOptions.Reranking; retrieval?: AISearchOptions.Retrieval; } namespace AISearchOptions { interface Cache { cache_threshold?: 'super_strict_match' | 'close_enough' | 'flexible_friend' | 'anything_goes'; enabled?: boolean; } interface QueryRewrite { enabled?: boolean; model?: '@cf/meta/llama-3.3-70b-instruct-fp8-fast' | '@cf/zai-org/glm-4.7-flash' | '@cf/meta/llama-3.1-8b-instruct-fast' | '@cf/meta/llama-3.1-8b-instruct-fp8' | '@cf/meta/llama-4-scout-17b-16e-instruct' | '@cf/qwen/qwen3-30b-a3b-fp8' | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' | '@cf/moonshotai/kimi-k2-instruct' | '@cf/google/gemma-3-12b-it' | '@cf/google/gemma-4-26b-a4b-it' | '@cf/moonshotai/kimi-k2.5' | 'anthropic/claude-3-7-sonnet' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-opus-4' | 'anthropic/claude-3-5-haiku' | 'cerebras/qwen-3-235b-a22b-instruct' | 'cerebras/qwen-3-235b-a22b-thinking' | 'cerebras/llama-3.3-70b' | 'cerebras/llama-4-maverick-17b-128e-instruct' | 'cerebras/llama-4-scout-17b-16e-instruct' | 'cerebras/gpt-oss-120b' | 'google-ai-studio/gemini-2.5-flash' | 'google-ai-studio/gemini-2.5-pro' | 'grok/grok-4' | 'groq/llama-3.3-70b-versatile' | 'groq/llama-3.1-8b-instant' | 'openai/gpt-5' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | ''; rewrite_prompt?: string; } interface Reranking { enabled?: boolean; match_threshold?: number; model?: '@cf/baai/bge-reranker-base' | ''; } interface Retrieval { /** * Metadata fields to boost search results by. Overrides the instance-level * boost_by config. Direction defaults to 'asc' for numeric/datetime fields, * 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined * custom_metadata field. */ boost_by?: Array; context_expansion?: number; filters?: { [key: string]: unknown; }; fusion_method?: 'max' | 'rrf'; /** * Controls which documents are candidates for BM25 scoring. 'and' restricts * candidates to documents containing all query terms; 'or' includes any document * containing at least one term, ranked by BM25 relevance. When omitted, falls back * to the instance-level retrieval_options.keyword_match_mode, then to 'and'. */ keyword_match_mode?: 'and' | 'or'; match_threshold?: number; max_num_results?: number; retrieval_type?: 'vector' | 'keyword' | 'hybrid'; return_on_failure?: boolean; } namespace Retrieval { interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any * custom_metadata field. Numeric and datetime fields support all four directions * (asc, desc, exists, not_exists); text/boolean fields only support * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; } } } interface Message { content: string | Array | null; role: 'system' | 'developer' | 'user' | 'assistant' | 'tool'; [k: string]: unknown; } namespace Message { interface UnionMember0 { text: string; type: 'text'; } interface UnionMember1 { image_url: UnionMember1.ImageURL; type: 'image_url'; } namespace UnionMember1 { interface ImageURL { url: string; } } interface UnionMember2 { file: UnionMember2.File; type: 'file'; } namespace UnionMember2 { interface File { filename: string; file_data?: string; file_id?: string; } } } } export interface NamespaceReadParams { account_id: string; } export interface NamespaceSearchParams { /** * Path param */ account_id: string; /** * Body param */ ai_search_options: NamespaceSearchParams.AISearchOptions; /** * Body param: OpenAI-compatible message array. For multimodal queries, set the * last user message's `content` to an array of typed parts: * `[{type:'text', text:'…'}, {type:'image_url', image_url:{url:'…'}}]`. Image * inputs require the RAG's embedding_model to declare 'image' in * supported_modalities. */ messages?: Array; /** * Body param: A simple text query string. Alternative to 'messages' — provide * either this or 'messages', not both. */ query?: string; } export declare namespace NamespaceSearchParams { interface AISearchOptions { instance_ids: Array; cache?: AISearchOptions.Cache; query_rewrite?: AISearchOptions.QueryRewrite; reranking?: AISearchOptions.Reranking; retrieval?: AISearchOptions.Retrieval; } namespace AISearchOptions { interface Cache { cache_threshold?: 'super_strict_match' | 'close_enough' | 'flexible_friend' | 'anything_goes'; enabled?: boolean; } interface QueryRewrite { enabled?: boolean; model?: '@cf/meta/llama-3.3-70b-instruct-fp8-fast' | '@cf/zai-org/glm-4.7-flash' | '@cf/meta/llama-3.1-8b-instruct-fast' | '@cf/meta/llama-3.1-8b-instruct-fp8' | '@cf/meta/llama-4-scout-17b-16e-instruct' | '@cf/qwen/qwen3-30b-a3b-fp8' | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' | '@cf/moonshotai/kimi-k2-instruct' | '@cf/google/gemma-3-12b-it' | '@cf/google/gemma-4-26b-a4b-it' | '@cf/moonshotai/kimi-k2.5' | 'anthropic/claude-3-7-sonnet' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-opus-4' | 'anthropic/claude-3-5-haiku' | 'cerebras/qwen-3-235b-a22b-instruct' | 'cerebras/qwen-3-235b-a22b-thinking' | 'cerebras/llama-3.3-70b' | 'cerebras/llama-4-maverick-17b-128e-instruct' | 'cerebras/llama-4-scout-17b-16e-instruct' | 'cerebras/gpt-oss-120b' | 'google-ai-studio/gemini-2.5-flash' | 'google-ai-studio/gemini-2.5-pro' | 'grok/grok-4' | 'groq/llama-3.3-70b-versatile' | 'groq/llama-3.1-8b-instant' | 'openai/gpt-5' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | ''; rewrite_prompt?: string; } interface Reranking { enabled?: boolean; match_threshold?: number; model?: '@cf/baai/bge-reranker-base' | ''; } interface Retrieval { /** * Metadata fields to boost search results by. Overrides the instance-level * boost_by config. Direction defaults to 'asc' for numeric/datetime fields, * 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined * custom_metadata field. */ boost_by?: Array; context_expansion?: number; filters?: { [key: string]: unknown; }; fusion_method?: 'max' | 'rrf'; /** * Controls which documents are candidates for BM25 scoring. 'and' restricts * candidates to documents containing all query terms; 'or' includes any document * containing at least one term, ranked by BM25 relevance. When omitted, falls back * to the instance-level retrieval_options.keyword_match_mode, then to 'and'. */ keyword_match_mode?: 'and' | 'or'; match_threshold?: number; max_num_results?: number; retrieval_type?: 'vector' | 'keyword' | 'hybrid'; return_on_failure?: boolean; } namespace Retrieval { interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any * custom_metadata field. Numeric and datetime fields support all four directions * (asc, desc, exists, not_exists); text/boolean fields only support * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; } } } interface Message { content: string | Array | null; role: 'system' | 'developer' | 'user' | 'assistant' | 'tool'; [k: string]: unknown; } namespace Message { interface UnionMember0 { text: string; type: 'text'; } interface UnionMember1 { image_url: UnionMember1.ImageURL; type: 'image_url'; } namespace UnionMember1 { interface ImageURL { url: string; } } interface UnionMember2 { file: UnionMember2.File; type: 'file'; } namespace UnionMember2 { interface File { filename: string; file_data?: string; file_id?: string; } } } } export declare namespace Namespaces { export { type NamespaceCreateResponse as NamespaceCreateResponse, type NamespaceUpdateResponse as NamespaceUpdateResponse, type NamespaceListResponse as NamespaceListResponse, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceChatCompletionsResponse as NamespaceChatCompletionsResponse, type NamespaceReadResponse as NamespaceReadResponse, type NamespaceSearchResponse as NamespaceSearchResponse, type NamespaceListResponsesV4PagePaginationArray as NamespaceListResponsesV4PagePaginationArray, type NamespaceCreateParams as NamespaceCreateParams, type NamespaceUpdateParams as NamespaceUpdateParams, type NamespaceListParams as NamespaceListParams, type NamespaceDeleteParams as NamespaceDeleteParams, type NamespaceChatCompletionsParams as NamespaceChatCompletionsParams, type NamespaceReadParams as NamespaceReadParams, type NamespaceSearchParams as NamespaceSearchParams, }; export { Instances as Instances, BaseInstances as BaseInstances, type InstanceCreateResponse as InstanceCreateResponse, type InstanceUpdateResponse as InstanceUpdateResponse, type InstanceListResponse as InstanceListResponse, type InstanceDeleteResponse as InstanceDeleteResponse, type InstanceChatCompletionsResponse as InstanceChatCompletionsResponse, type InstanceReadResponse as InstanceReadResponse, type InstanceSearchResponse as InstanceSearchResponse, type InstanceStatsResponse as InstanceStatsResponse, type InstanceListResponsesV4PagePaginationArray as InstanceListResponsesV4PagePaginationArray, type InstanceCreateParams as InstanceCreateParams, type InstanceUpdateParams as InstanceUpdateParams, type InstanceListParams as InstanceListParams, type InstanceDeleteParams as InstanceDeleteParams, type InstanceChatCompletionsParams as InstanceChatCompletionsParams, type InstanceReadParams as InstanceReadParams, type InstanceSearchParams as InstanceSearchParams, type InstanceStatsParams as InstanceStatsParams, }; } //# sourceMappingURL=namespaces.d.ts.map