From 961ecbb96db49d21964e3a77e655075db1172c1e Mon Sep 17 00:00:00 2001 From: Acbox Date: Mon, 16 Feb 2026 01:22:15 +0800 Subject: [PATCH] feat: search provider --- agent/src/agent.ts | 3 +- agent/src/index.ts | 12 - agent/src/modules/chat.ts | 5 +- agent/src/tools/index.ts | 13 +- agent/src/tools/subagent.ts | 6 +- agent/src/tools/web.ts | 91 +---- agent/src/types/agent.ts | 6 - cmd/agent/main.go | 11 +- db/migrations/0001_init.down.sql | 1 + db/migrations/0001_init.up.sql | 12 + db/queries/bots.sql | 12 +- db/queries/search_providers.sql | 36 ++ db/queries/settings.sql | 14 +- docker/config/config.docker.toml | 4 - internal/bots/service_test.go | 17 +- internal/db/sqlc/bots.sql.go | 18 +- internal/db/sqlc/conversations.sql.go | 2 +- internal/db/sqlc/models.go | 10 + internal/db/sqlc/search_providers.sql.go | 189 ++++++++++ internal/db/sqlc/settings.sql.go | 20 +- internal/handlers/search_providers.go | 163 ++++++++ internal/mcp/providers/web/provider.go | 211 +++++++++++ internal/searchproviders/service.go | 191 ++++++++++ internal/searchproviders/types.go | 49 +++ internal/settings/service.go | 13 + internal/settings/types.go | 2 + packages/config/src/types.ts | 5 - packages/sdk/src/@pinia/colada.gen.ts | 109 +++++- packages/sdk/src/index.ts | 4 +- packages/sdk/src/sdk.gen.ts | 58 ++- packages/sdk/src/types.gen.ts | 233 ++++++++++++ .../components/search-provider-logo/icons.ts | 21 ++ .../components/search-provider-logo/index.vue | 33 ++ packages/web/src/components/sidebar/index.vue | 5 + packages/web/src/i18n/locales/en.json | 21 +- packages/web/src/i18n/locales/zh.json | 21 +- packages/web/src/main.ts | 3 +- .../pages/bots/components/bot-settings.vue | 25 +- .../components/search-provider-select.vue | 163 ++++++++ .../components/add-search-provider.vue | 155 ++++++++ .../components/brave-settings.vue | 54 +++ .../components/provider-setting.vue | 196 ++++++++++ .../web/src/pages/search-providers/index.vue | 191 ++++++++++ packages/web/src/router.ts | 8 + spec/docs.go | 356 ++++++++++++++++++ spec/swagger.json | 356 ++++++++++++++++++ spec/swagger.yaml | 235 ++++++++++++ 47 files changed, 3189 insertions(+), 174 deletions(-) create mode 100644 db/queries/search_providers.sql create mode 100644 internal/db/sqlc/search_providers.sql.go create mode 100644 internal/handlers/search_providers.go create mode 100644 internal/mcp/providers/web/provider.go create mode 100644 internal/searchproviders/service.go create mode 100644 internal/searchproviders/types.go create mode 100644 packages/web/src/components/search-provider-logo/icons.ts create mode 100644 packages/web/src/components/search-provider-logo/index.vue create mode 100644 packages/web/src/pages/bots/components/search-provider-select.vue create mode 100644 packages/web/src/pages/search-providers/components/add-search-provider.vue create mode 100644 packages/web/src/pages/search-providers/components/brave-settings.vue create mode 100644 packages/web/src/pages/search-providers/components/provider-setting.vue create mode 100644 packages/web/src/pages/search-providers/index.vue diff --git a/agent/src/agent.ts b/agent/src/agent.ts index 20672422..10c0ff2a 100644 --- a/agent/src/agent.ts +++ b/agent/src/agent.ts @@ -35,7 +35,6 @@ export const createAgent = ( { model: modelConfig, activeContextTime = 24 * 60, - brave, language = 'Same as the user input', allowedActions = allActions, channels = [], @@ -160,7 +159,7 @@ export const createAgent = ( fetch, botId, }) - const tools = getTools(allowedActions, { fetch, model: modelConfig, brave, identity, auth, enableSkill }) + const tools = getTools(allowedActions, { fetch, model: modelConfig, identity, auth, enableSkill }) return { tools: { ...mcpTools, ...tools } as ToolSet, close: closeMCP, diff --git a/agent/src/index.ts b/agent/src/index.ts index 7cc39d68..94126852 100644 --- a/agent/src/index.ts +++ b/agent/src/index.ts @@ -6,18 +6,6 @@ import { loadConfig, getBaseUrl as getBaseUrlByConfig } from '@memoh/config' const config = loadConfig('../config.toml') -export const getBraveConfig = () => { - const apiKey = config.brave?.api_key?.trim() ?? '' - if (!apiKey) { - return undefined - } - const baseUrl = config.brave?.base_url?.trim() || 'https://api.search.brave.com/res/v1/' - return { - apiKey, - baseUrl, - } -} - export const getBaseUrl = () => { return getBaseUrlByConfig(config) } diff --git a/agent/src/modules/chat.ts b/agent/src/modules/chat.ts index abcca61b..c9d04099 100644 --- a/agent/src/modules/chat.ts +++ b/agent/src/modules/chat.ts @@ -1,7 +1,7 @@ import { Elysia, sse } from 'elysia' import z from 'zod' import { createAgent } from '../agent' -import { createAuthFetcher, getBaseUrl, getBraveConfig } from '../index' +import { createAuthFetcher, getBaseUrl } from '../index' import { ModelConfig } from '../types' import { bearerMiddleware } from '../middlewares/bearer' import { AgentSkillModel, AllowedActionModel, AttachmentModel, IdentityContextModel, MCPConnectionModel, ModelConfigModel, ScheduleModel } from '../models' @@ -38,7 +38,6 @@ export const chatModule = new Elysia({ prefix: '/chat' }) baseUrl: getBaseUrl(), }, skills: body.usableSkills, - brave: getBraveConfig(), mcpConnections: body.mcpConnections, }, authFetcher) return ask({ @@ -68,7 +67,6 @@ export const chatModule = new Elysia({ prefix: '/chat' }) baseUrl: getBaseUrl(), }, skills: body.usableSkills, - brave: getBraveConfig(), mcpConnections: body.mcpConnections, }, authFetcher) for await (const action of stream({ @@ -108,7 +106,6 @@ export const chatModule = new Elysia({ prefix: '/chat' }) baseUrl: getBaseUrl(), }, skills: body.usableSkills, - brave: getBraveConfig(), mcpConnections: body.mcpConnections, }, authFetcher) return triggerSchedule({ diff --git a/agent/src/tools/index.ts b/agent/src/tools/index.ts index ff9a443e..1e1b2230 100644 --- a/agent/src/tools/index.ts +++ b/agent/src/tools/index.ts @@ -1,5 +1,5 @@ import { AuthFetcher } from '..' -import { AgentAction, AgentAuthContext, BraveConfig, IdentityContext, ModelConfig } from '../types' +import { AgentAction, AgentAuthContext, IdentityContext, ModelConfig } from '../types' import { ToolSet } from 'ai' import { getWebTools } from './web' import { getSubagentTools } from './subagent' @@ -8,7 +8,6 @@ import { getSkillTools } from './skill' export interface ToolsParams { fetch: AuthFetcher model: ModelConfig - brave?: BraveConfig identity: IdentityContext auth: AgentAuthContext enableSkill: (skill: string) => void @@ -16,15 +15,15 @@ export interface ToolsParams { export const getTools = ( actions: AgentAction[], - { fetch, model, brave, identity, auth, enableSkill }: ToolsParams + { fetch, model, identity, auth, enableSkill }: ToolsParams ) => { const tools: ToolSet = {} - if (actions.includes(AgentAction.Web) && brave) { - const webTools = getWebTools({ brave }) + if (actions.includes(AgentAction.Web)) { + const webTools = getWebTools() Object.assign(tools, webTools) } if (actions.includes(AgentAction.Subagent)) { - const subagentTools = getSubagentTools({ fetch, model, brave, identity, auth }) + const subagentTools = getSubagentTools({ fetch, model, identity, auth }) Object.assign(tools, subagentTools) } if (actions.includes(AgentAction.Skill)) { @@ -32,4 +31,4 @@ export const getTools = ( Object.assign(tools, skillTools) } return tools -} \ No newline at end of file +} diff --git a/agent/src/tools/subagent.ts b/agent/src/tools/subagent.ts index 65321660..d73b394f 100644 --- a/agent/src/tools/subagent.ts +++ b/agent/src/tools/subagent.ts @@ -1,19 +1,18 @@ import { tool } from 'ai' import { z } from 'zod' import { createAgent } from '../agent' -import { ModelConfig, BraveConfig, AgentAuthContext } from '../types' +import { ModelConfig, AgentAuthContext } from '../types' import { AuthFetcher } from '..' import { AgentAction, IdentityContext } from '../types/agent' export interface SubagentToolParams { fetch: AuthFetcher model: ModelConfig - brave?: BraveConfig identity: IdentityContext auth: AgentAuthContext } -export const getSubagentTools = ({ fetch, model, brave, identity, auth }: SubagentToolParams) => { +export const getSubagentTools = ({ fetch, model, identity, auth }: SubagentToolParams) => { const botId = identity.botId.trim() const base = `/bots/${botId}/subagents` @@ -84,7 +83,6 @@ export const getSubagentTools = ({ fetch, model, brave, identity, auth }: Subage const contextMessages = Array.isArray(contextPayload?.messages) ? contextPayload.messages : [] const { askAsSubagent } = createAgent({ model, - brave, allowedActions: [ AgentAction.Web, ], diff --git a/agent/src/tools/web.ts b/agent/src/tools/web.ts index 02930c77..45cb0565 100644 --- a/agent/src/tools/web.ts +++ b/agent/src/tools/web.ts @@ -3,96 +3,10 @@ import { z } from 'zod' import { Readability } from '@mozilla/readability' import { JSDOM } from 'jsdom' import TurndownService from 'turndown' -import { BraveConfig } from '../types' const turndownService = new TurndownService() -interface WebToolParams { - brave: BraveConfig -} - -interface BraveSearchResult { - type: string - title: string - url: string - description?: string - age?: string -} - -interface BraveSearchResponse { - web?: { - results: BraveSearchResult[] - } -} - -export const getWebTools = ({ brave }: WebToolParams) => { - const { apiKey, baseUrl = 'https://api.search.brave.com/res/v1/' } = brave - const webSearch = tool({ - description: 'Search the web for information using Brave Search API. Use this when you need current information, facts, news, or any web content.', - inputSchema: z.object({ - query: z.string().describe('The search query to look up on the web'), - count: z.number().optional().describe('Number of results to return (default: 10, max: 20)'), - }), - execute: async ({ query, count = 10 }) => { - try { - const url = new URL('web/search', baseUrl) - url.searchParams.append('q', query) - url.searchParams.append('count', Math.min(count, 20).toString()) - - const response = await fetch(url.toString(), { - method: 'GET', - headers: { - 'Accept': 'application/json', - 'Accept-Encoding': 'gzip', - 'X-Subscription-Token': apiKey, - }, - }) - - if (!response.ok) { - const errorText = await response.text() - console.error('[Web Search] error', { - type: 'web_search', - query, - count, - status: response.status, - statusText: response.statusText, - error: errorText, - }) - throw new Error(`Brave Search API error: ${response.status} ${response.statusText}`) - } - - const data: BraveSearchResponse = await response.json() - - const results = data.web?.results || [] - - if (results.length === 0) { - return { - success: false, - message: 'No results found for the query', - query, - } - } - - return { - success: true, - query, - results: results.map((result) => ({ - title: result.title, - url: result.url, - description: result.description, - age: result.age, - })), - } - } catch (error) { - return { - success: false, - error: error instanceof Error ? error.message : 'Unknown error occurred', - query, - } - } - }, - }) - +export const getWebTools = () => { const webFetch = tool({ description: 'Fetch a URL and convert the response to readable content. Supports HTML (converts to Markdown), JSON, XML, and plain text formats.', inputSchema: z.object({ @@ -220,7 +134,6 @@ export const getWebTools = ({ brave }: WebToolParams) => { }) return { - 'web_search': webSearch, 'web_fetch': webFetch, } -} \ No newline at end of file +} diff --git a/agent/src/types/agent.ts b/agent/src/types/agent.ts index 50e60569..51174d97 100644 --- a/agent/src/types/agent.ts +++ b/agent/src/types/agent.ts @@ -38,18 +38,12 @@ export enum AgentAction { export const allActions = Object.values(AgentAction) -export interface BraveConfig { - apiKey: string - baseUrl: string -} - export interface AgentParams { model: ModelConfig language?: string activeContextTime?: number allowedActions?: AgentAction[] mcpConnections?: MCPConnection[] - brave?: BraveConfig channels?: string[] currentChannel?: string identity?: IdentityContext diff --git a/cmd/agent/main.go b/cmd/agent/main.go index 6ba1bcf3..b0656bf4 100644 --- a/cmd/agent/main.go +++ b/cmd/agent/main.go @@ -26,6 +26,7 @@ import ( "github.com/memohai/memoh/internal/channel/adapters/local" "github.com/memohai/memoh/internal/channel/adapters/telegram" "github.com/memohai/memoh/internal/channel/identities" + "github.com/memohai/memoh/internal/channel/inbound" "github.com/memohai/memoh/internal/channel/route" "github.com/memohai/memoh/internal/config" ctr "github.com/memohai/memoh/internal/containerd" @@ -42,6 +43,7 @@ import ( mcpmemory "github.com/memohai/memoh/internal/mcp/providers/memory" mcpmessage "github.com/memohai/memoh/internal/mcp/providers/message" mcpschedule "github.com/memohai/memoh/internal/mcp/providers/schedule" + mcpweb "github.com/memohai/memoh/internal/mcp/providers/web" mcpfederation "github.com/memohai/memoh/internal/mcp/sources/federation" "github.com/memohai/memoh/internal/memory" "github.com/memohai/memoh/internal/message" @@ -50,8 +52,8 @@ import ( "github.com/memohai/memoh/internal/policy" "github.com/memohai/memoh/internal/preauth" "github.com/memohai/memoh/internal/providers" - "github.com/memohai/memoh/internal/channel/inbound" "github.com/memohai/memoh/internal/schedule" + "github.com/memohai/memoh/internal/searchproviders" "github.com/memohai/memoh/internal/server" "github.com/memohai/memoh/internal/settings" "github.com/memohai/memoh/internal/subagent" @@ -87,6 +89,7 @@ func main() { accounts.NewService, settings.NewService, providers.NewService, + searchproviders.NewService, policy.NewService, preauth.NewService, mcp.NewConnectionService, @@ -124,6 +127,7 @@ func main() { provideServerHandler(provideMessageHandler), provideServerHandler(handlers.NewSwaggerHandler), provideServerHandler(handlers.NewProvidersHandler), + provideServerHandler(handlers.NewSearchProvidersHandler), provideServerHandler(handlers.NewModelsHandler), provideServerHandler(handlers.NewSettingsHandler), provideServerHandler(handlers.NewPreauthHandler), @@ -344,11 +348,12 @@ func provideContainerdHandler(log *slog.Logger, service ctr.Service, cfg config. return handlers.NewContainerdHandler(log, service, cfg.MCP, cfg.Containerd.Namespace, botService, accountService, policyService, queries) } -func provideToolGatewayService(log *slog.Logger, cfg config.Config, channelManager *channel.Manager, registry *channel.Registry, channelService *channel.Service, scheduleService *schedule.Service, memoryService *memory.Service, chatService *conversation.Service, accountService *accounts.Service, manager *mcp.Manager, containerdHandler *handlers.ContainerdHandler, mcpConnService *mcp.ConnectionService) *mcp.ToolGatewayService { +func provideToolGatewayService(log *slog.Logger, cfg config.Config, channelManager *channel.Manager, registry *channel.Registry, channelService *channel.Service, scheduleService *schedule.Service, memoryService *memory.Service, chatService *conversation.Service, accountService *accounts.Service, settingsService *settings.Service, searchProviderService *searchproviders.Service, manager *mcp.Manager, containerdHandler *handlers.ContainerdHandler, mcpConnService *mcp.ConnectionService) *mcp.ToolGatewayService { messageExec := mcpmessage.NewExecutor(log, channelManager, channelManager, registry) directoryExec := mcpdirectory.NewExecutor(log, registry, channelService, registry) scheduleExec := mcpschedule.NewExecutor(log, scheduleService) memoryExec := mcpmemory.NewExecutor(log, memoryService, chatService, accountService) + webExec := mcpweb.NewExecutor(log, settingsService, searchProviderService) execWorkDir := cfg.MCP.DataMount if strings.TrimSpace(execWorkDir) == "" { execWorkDir = config.DefaultDataMount @@ -360,7 +365,7 @@ func provideToolGatewayService(log *slog.Logger, cfg config.Config, channelManag svc := mcp.NewToolGatewayService( log, - []mcp.ToolExecutor{messageExec, directoryExec, scheduleExec, memoryExec, fsExec}, + []mcp.ToolExecutor{messageExec, directoryExec, scheduleExec, memoryExec, webExec, fsExec}, []mcp.ToolSource{fedSource}, ) containerdHandler.SetToolGatewayService(svc) diff --git a/db/migrations/0001_init.down.sql b/db/migrations/0001_init.down.sql index 8369a94b..e0861ca1 100644 --- a/db/migrations/0001_init.down.sql +++ b/db/migrations/0001_init.down.sql @@ -14,6 +14,7 @@ DROP TABLE IF EXISTS bot_members; DROP TABLE IF EXISTS bots; DROP TABLE IF EXISTS model_variants; DROP TABLE IF EXISTS models; +DROP TABLE IF EXISTS search_providers; DROP TABLE IF EXISTS llm_providers; DROP TABLE IF EXISTS user_channel_bindings; DROP TABLE IF EXISTS channel_identities; diff --git a/db/migrations/0001_init.up.sql b/db/migrations/0001_init.up.sql index ee738478..6b8b7cb6 100644 --- a/db/migrations/0001_init.up.sql +++ b/db/migrations/0001_init.up.sql @@ -69,6 +69,17 @@ CREATE TABLE IF NOT EXISTS llm_providers ( CONSTRAINT llm_providers_client_type_check CHECK (client_type IN ('openai', 'openai-compat', 'anthropic', 'google', 'azure', 'bedrock', 'mistral', 'xai', 'ollama', 'dashscope')) ); +CREATE TABLE IF NOT EXISTS search_providers ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + name TEXT NOT NULL, + provider TEXT NOT NULL, + config JSONB NOT NULL DEFAULT '{}'::jsonb, + created_at TIMESTAMPTZ NOT NULL DEFAULT now(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT now(), + CONSTRAINT search_providers_name_unique UNIQUE (name), + CONSTRAINT search_providers_provider_check CHECK (provider IN ('brave')) +); + CREATE TABLE IF NOT EXISTS models ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), model_id TEXT NOT NULL, @@ -111,6 +122,7 @@ CREATE TABLE IF NOT EXISTS bots ( chat_model_id UUID REFERENCES models(id) ON DELETE SET NULL, memory_model_id UUID REFERENCES models(id) ON DELETE SET NULL, embedding_model_id UUID REFERENCES models(id) ON DELETE SET NULL, + search_provider_id UUID REFERENCES search_providers(id) ON DELETE SET NULL, metadata JSONB NOT NULL DEFAULT '{}'::jsonb, created_at TIMESTAMPTZ NOT NULL DEFAULT now(), updated_at TIMESTAMPTZ NOT NULL DEFAULT now(), diff --git a/db/queries/bots.sql b/db/queries/bots.sql index 6194f319..0ee27164 100644 --- a/db/queries/bots.sql +++ b/db/queries/bots.sql @@ -1,21 +1,21 @@ -- name: CreateBot :one INSERT INTO bots (owner_user_id, type, display_name, avatar_url, is_active, metadata, status) VALUES ($1, $2, $3, $4, $5, $6, $7) -RETURNING id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, metadata, created_at, updated_at; +RETURNING id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, search_provider_id, metadata, created_at, updated_at; -- name: GetBotByID :one -SELECT id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, metadata, created_at, updated_at +SELECT id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, search_provider_id, metadata, created_at, updated_at FROM bots WHERE id = $1; -- name: ListBotsByOwner :many -SELECT id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, metadata, created_at, updated_at +SELECT id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, search_provider_id, metadata, created_at, updated_at FROM bots WHERE owner_user_id = $1 ORDER BY created_at DESC; -- name: ListBotsByMember :many -SELECT b.id, b.owner_user_id, b.type, b.display_name, b.avatar_url, b.is_active, b.status, b.max_context_load_time, b.language, b.allow_guest, b.chat_model_id, b.memory_model_id, b.embedding_model_id, b.metadata, b.created_at, b.updated_at +SELECT b.id, b.owner_user_id, b.type, b.display_name, b.avatar_url, b.is_active, b.status, b.max_context_load_time, b.language, b.allow_guest, b.chat_model_id, b.memory_model_id, b.embedding_model_id, b.search_provider_id, b.metadata, b.created_at, b.updated_at FROM bots b JOIN bot_members m ON m.bot_id = b.id WHERE m.user_id = $1 @@ -29,14 +29,14 @@ SET display_name = $2, metadata = $5, updated_at = now() WHERE id = $1 -RETURNING id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, metadata, created_at, updated_at; +RETURNING id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, search_provider_id, metadata, created_at, updated_at; -- name: UpdateBotOwner :one UPDATE bots SET owner_user_id = $2, updated_at = now() WHERE id = $1 -RETURNING id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, metadata, created_at, updated_at; +RETURNING id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, search_provider_id, metadata, created_at, updated_at; -- name: UpdateBotStatus :exec UPDATE bots diff --git a/db/queries/search_providers.sql b/db/queries/search_providers.sql new file mode 100644 index 00000000..b4ad0ee4 --- /dev/null +++ b/db/queries/search_providers.sql @@ -0,0 +1,36 @@ +-- name: CreateSearchProvider :one +INSERT INTO search_providers (name, provider, config) +VALUES ( + sqlc.arg(name), + sqlc.arg(provider), + sqlc.arg(config) +) +RETURNING *; + +-- name: GetSearchProviderByID :one +SELECT * FROM search_providers WHERE id = sqlc.arg(id); + +-- name: GetSearchProviderByName :one +SELECT * FROM search_providers WHERE name = sqlc.arg(name); + +-- name: ListSearchProviders :many +SELECT * FROM search_providers +ORDER BY created_at DESC; + +-- name: ListSearchProvidersByProvider :many +SELECT * FROM search_providers +WHERE provider = sqlc.arg(provider) +ORDER BY created_at DESC; + +-- name: UpdateSearchProvider :one +UPDATE search_providers +SET + name = sqlc.arg(name), + provider = sqlc.arg(provider), + config = sqlc.arg(config), + updated_at = now() +WHERE id = sqlc.arg(id) +RETURNING *; + +-- name: DeleteSearchProvider :exec +DELETE FROM search_providers WHERE id = sqlc.arg(id); diff --git a/db/queries/settings.sql b/db/queries/settings.sql index 1783b5f0..33651ecf 100644 --- a/db/queries/settings.sql +++ b/db/queries/settings.sql @@ -6,11 +6,13 @@ SELECT bots.allow_guest, chat_models.model_id AS chat_model_id, memory_models.model_id AS memory_model_id, - embedding_models.model_id AS embedding_model_id + embedding_models.model_id AS embedding_model_id, + search_providers.id::text AS search_provider_id FROM bots LEFT JOIN models AS chat_models ON chat_models.id = bots.chat_model_id LEFT JOIN models AS memory_models ON memory_models.id = bots.memory_model_id LEFT JOIN models AS embedding_models ON embedding_models.id = bots.embedding_model_id +LEFT JOIN search_providers ON search_providers.id = bots.search_provider_id WHERE bots.id = $1; -- name: UpsertBotSettings :one @@ -22,9 +24,10 @@ WITH updated AS ( chat_model_id = COALESCE(sqlc.narg(chat_model_id)::uuid, bots.chat_model_id), memory_model_id = COALESCE(sqlc.narg(memory_model_id)::uuid, bots.memory_model_id), embedding_model_id = COALESCE(sqlc.narg(embedding_model_id)::uuid, bots.embedding_model_id), + search_provider_id = COALESCE(sqlc.narg(search_provider_id)::uuid, bots.search_provider_id), updated_at = now() WHERE bots.id = sqlc.arg(id) - RETURNING bots.id, bots.max_context_load_time, bots.language, bots.allow_guest, bots.chat_model_id, bots.memory_model_id, bots.embedding_model_id + RETURNING bots.id, bots.max_context_load_time, bots.language, bots.allow_guest, bots.chat_model_id, bots.memory_model_id, bots.embedding_model_id, bots.search_provider_id ) SELECT updated.id AS bot_id, @@ -33,11 +36,13 @@ SELECT updated.allow_guest, chat_models.model_id AS chat_model_id, memory_models.model_id AS memory_model_id, - embedding_models.model_id AS embedding_model_id + embedding_models.model_id AS embedding_model_id, + search_providers.id::text AS search_provider_id FROM updated LEFT JOIN models AS chat_models ON chat_models.id = updated.chat_model_id LEFT JOIN models AS memory_models ON memory_models.id = updated.memory_model_id -LEFT JOIN models AS embedding_models ON embedding_models.id = updated.embedding_model_id; +LEFT JOIN models AS embedding_models ON embedding_models.id = updated.embedding_model_id +LEFT JOIN search_providers ON search_providers.id = updated.search_provider_id; -- name: DeleteSettingsByBotID :exec UPDATE bots @@ -47,5 +52,6 @@ SET max_context_load_time = 1440, chat_model_id = NULL, memory_model_id = NULL, embedding_model_id = NULL, + search_provider_id = NULL, updated_at = now() WHERE id = $1; diff --git a/docker/config/config.docker.toml b/docker/config/config.docker.toml index 6bd6e9e9..159023e7 100644 --- a/docker/config/config.docker.toml +++ b/docker/config/config.docker.toml @@ -54,7 +54,3 @@ server_addr = "server:8080" [web] host = "127.0.0.1" port = 8082 - -[brave] -api_key = "" -base_url = "https://api.search.brave.com/res/v1/" diff --git a/internal/bots/service_test.go b/internal/bots/service_test.go index 67db8399..8e6072fe 100644 --- a/internal/bots/service_test.go +++ b/internal/bots/service_test.go @@ -44,7 +44,7 @@ func (d *fakeDBTX) QueryRow(ctx context.Context, sql string, args ...any) pgx.Ro func makeBotRow(botID, ownerUserID pgtype.UUID, botType string, allowGuest bool) *fakeRow { return &fakeRow{ scanFunc: func(dest ...any) error { - if len(dest) < 16 { + if len(dest) < 17 { return pgx.ErrNoRows } *dest[0].(*pgtype.UUID) = botID @@ -60,9 +60,10 @@ func makeBotRow(botID, ownerUserID pgtype.UUID, botType string, allowGuest bool) *dest[10].(*pgtype.UUID) = pgtype.UUID{} *dest[11].(*pgtype.UUID) = pgtype.UUID{} *dest[12].(*pgtype.UUID) = pgtype.UUID{} - *dest[13].(*[]byte) = []byte(`{}`) - *dest[14].(*pgtype.Timestamptz) = pgtype.Timestamptz{} + *dest[13].(*pgtype.UUID) = pgtype.UUID{} + *dest[14].(*[]byte) = []byte(`{}`) *dest[15].(*pgtype.Timestamptz) = pgtype.Timestamptz{} + *dest[16].(*pgtype.Timestamptz) = pgtype.Timestamptz{} return nil }, } @@ -149,12 +150,12 @@ func TestAuthorizeAccess(t *testing.T) { wantErrIs: ErrBotAccessDenied, }, { - name: "stranger allowed when policy and bot both allow guest", - userID: strangerID, - policy: AccessPolicy{AllowGuest: true}, - botType: BotTypePublic, + name: "stranger allowed when policy and bot both allow guest", + userID: strangerID, + policy: AccessPolicy{AllowGuest: true}, + botType: BotTypePublic, allowGst: true, - wantErr: false, + wantErr: false, }, { name: "guest not allowed on personal bot", diff --git a/internal/db/sqlc/bots.sql.go b/internal/db/sqlc/bots.sql.go index 7d175c97..a5243268 100644 --- a/internal/db/sqlc/bots.sql.go +++ b/internal/db/sqlc/bots.sql.go @@ -14,7 +14,7 @@ import ( const createBot = `-- name: CreateBot :one INSERT INTO bots (owner_user_id, type, display_name, avatar_url, is_active, metadata, status) VALUES ($1, $2, $3, $4, $5, $6, $7) -RETURNING id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, metadata, created_at, updated_at +RETURNING id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, search_provider_id, metadata, created_at, updated_at ` type CreateBotParams struct { @@ -52,6 +52,7 @@ func (q *Queries) CreateBot(ctx context.Context, arg CreateBotParams) (Bot, erro &i.ChatModelID, &i.MemoryModelID, &i.EmbeddingModelID, + &i.SearchProviderID, &i.Metadata, &i.CreatedAt, &i.UpdatedAt, @@ -83,7 +84,7 @@ func (q *Queries) DeleteBotMember(ctx context.Context, arg DeleteBotMemberParams } const getBotByID = `-- name: GetBotByID :one -SELECT id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, metadata, created_at, updated_at +SELECT id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, search_provider_id, metadata, created_at, updated_at FROM bots WHERE id = $1 ` @@ -105,6 +106,7 @@ func (q *Queries) GetBotByID(ctx context.Context, id pgtype.UUID) (Bot, error) { &i.ChatModelID, &i.MemoryModelID, &i.EmbeddingModelID, + &i.SearchProviderID, &i.Metadata, &i.CreatedAt, &i.UpdatedAt, @@ -169,7 +171,7 @@ func (q *Queries) ListBotMembers(ctx context.Context, botID pgtype.UUID) ([]BotM } const listBotsByMember = `-- name: ListBotsByMember :many -SELECT b.id, b.owner_user_id, b.type, b.display_name, b.avatar_url, b.is_active, b.status, b.max_context_load_time, b.language, b.allow_guest, b.chat_model_id, b.memory_model_id, b.embedding_model_id, b.metadata, b.created_at, b.updated_at +SELECT b.id, b.owner_user_id, b.type, b.display_name, b.avatar_url, b.is_active, b.status, b.max_context_load_time, b.language, b.allow_guest, b.chat_model_id, b.memory_model_id, b.embedding_model_id, b.search_provider_id, b.metadata, b.created_at, b.updated_at FROM bots b JOIN bot_members m ON m.bot_id = b.id WHERE m.user_id = $1 @@ -199,6 +201,7 @@ func (q *Queries) ListBotsByMember(ctx context.Context, userID pgtype.UUID) ([]B &i.ChatModelID, &i.MemoryModelID, &i.EmbeddingModelID, + &i.SearchProviderID, &i.Metadata, &i.CreatedAt, &i.UpdatedAt, @@ -214,7 +217,7 @@ func (q *Queries) ListBotsByMember(ctx context.Context, userID pgtype.UUID) ([]B } const listBotsByOwner = `-- name: ListBotsByOwner :many -SELECT id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, metadata, created_at, updated_at +SELECT id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, search_provider_id, metadata, created_at, updated_at FROM bots WHERE owner_user_id = $1 ORDER BY created_at DESC @@ -243,6 +246,7 @@ func (q *Queries) ListBotsByOwner(ctx context.Context, ownerUserID pgtype.UUID) &i.ChatModelID, &i.MemoryModelID, &i.EmbeddingModelID, + &i.SearchProviderID, &i.Metadata, &i.CreatedAt, &i.UpdatedAt, @@ -262,7 +266,7 @@ UPDATE bots SET owner_user_id = $2, updated_at = now() WHERE id = $1 -RETURNING id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, metadata, created_at, updated_at +RETURNING id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, search_provider_id, metadata, created_at, updated_at ` type UpdateBotOwnerParams struct { @@ -287,6 +291,7 @@ func (q *Queries) UpdateBotOwner(ctx context.Context, arg UpdateBotOwnerParams) &i.ChatModelID, &i.MemoryModelID, &i.EmbeddingModelID, + &i.SearchProviderID, &i.Metadata, &i.CreatedAt, &i.UpdatedAt, @@ -302,7 +307,7 @@ SET display_name = $2, metadata = $5, updated_at = now() WHERE id = $1 -RETURNING id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, metadata, created_at, updated_at +RETURNING id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, search_provider_id, metadata, created_at, updated_at ` type UpdateBotProfileParams struct { @@ -336,6 +341,7 @@ func (q *Queries) UpdateBotProfile(ctx context.Context, arg UpdateBotProfilePara &i.ChatModelID, &i.MemoryModelID, &i.EmbeddingModelID, + &i.SearchProviderID, &i.Metadata, &i.CreatedAt, &i.UpdatedAt, diff --git a/internal/db/sqlc/conversations.sql.go b/internal/db/sqlc/conversations.sql.go index 01fcf6b9..c5c15ca4 100644 --- a/internal/db/sqlc/conversations.sql.go +++ b/internal/db/sqlc/conversations.sql.go @@ -590,7 +590,7 @@ WITH updated AS ( SET display_name = $1, updated_at = now() WHERE bots.id = $2 - RETURNING id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, metadata, created_at, updated_at + RETURNING id, owner_user_id, type, display_name, avatar_url, is_active, status, max_context_load_time, language, allow_guest, chat_model_id, memory_model_id, embedding_model_id, search_provider_id, metadata, created_at, updated_at ) SELECT updated.id AS id, diff --git a/internal/db/sqlc/models.go b/internal/db/sqlc/models.go index 6eea8817..caf27f9a 100644 --- a/internal/db/sqlc/models.go +++ b/internal/db/sqlc/models.go @@ -22,6 +22,7 @@ type Bot struct { ChatModelID pgtype.UUID `json:"chat_model_id"` MemoryModelID pgtype.UUID `json:"memory_model_id"` EmbeddingModelID pgtype.UUID `json:"embedding_model_id"` + SearchProviderID pgtype.UUID `json:"search_provider_id"` Metadata []byte `json:"metadata"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` @@ -202,6 +203,15 @@ type Schedule struct { BotID pgtype.UUID `json:"bot_id"` } +type SearchProvider struct { + ID pgtype.UUID `json:"id"` + Name string `json:"name"` + Provider string `json:"provider"` + Config []byte `json:"config"` + CreatedAt pgtype.Timestamptz `json:"created_at"` + UpdatedAt pgtype.Timestamptz `json:"updated_at"` +} + type Snapshot struct { ID string `json:"id"` ContainerID string `json:"container_id"` diff --git a/internal/db/sqlc/search_providers.sql.go b/internal/db/sqlc/search_providers.sql.go new file mode 100644 index 00000000..a7b266c0 --- /dev/null +++ b/internal/db/sqlc/search_providers.sql.go @@ -0,0 +1,189 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.30.0 +// source: search_providers.sql + +package sqlc + +import ( + "context" + + "github.com/jackc/pgx/v5/pgtype" +) + +const createSearchProvider = `-- name: CreateSearchProvider :one +INSERT INTO search_providers (name, provider, config) +VALUES ( + $1, + $2, + $3 +) +RETURNING id, name, provider, config, created_at, updated_at +` + +type CreateSearchProviderParams struct { + Name string `json:"name"` + Provider string `json:"provider"` + Config []byte `json:"config"` +} + +func (q *Queries) CreateSearchProvider(ctx context.Context, arg CreateSearchProviderParams) (SearchProvider, error) { + row := q.db.QueryRow(ctx, createSearchProvider, arg.Name, arg.Provider, arg.Config) + var i SearchProvider + err := row.Scan( + &i.ID, + &i.Name, + &i.Provider, + &i.Config, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const deleteSearchProvider = `-- name: DeleteSearchProvider :exec +DELETE FROM search_providers WHERE id = $1 +` + +func (q *Queries) DeleteSearchProvider(ctx context.Context, id pgtype.UUID) error { + _, err := q.db.Exec(ctx, deleteSearchProvider, id) + return err +} + +const getSearchProviderByID = `-- name: GetSearchProviderByID :one +SELECT id, name, provider, config, created_at, updated_at FROM search_providers WHERE id = $1 +` + +func (q *Queries) GetSearchProviderByID(ctx context.Context, id pgtype.UUID) (SearchProvider, error) { + row := q.db.QueryRow(ctx, getSearchProviderByID, id) + var i SearchProvider + err := row.Scan( + &i.ID, + &i.Name, + &i.Provider, + &i.Config, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const getSearchProviderByName = `-- name: GetSearchProviderByName :one +SELECT id, name, provider, config, created_at, updated_at FROM search_providers WHERE name = $1 +` + +func (q *Queries) GetSearchProviderByName(ctx context.Context, name string) (SearchProvider, error) { + row := q.db.QueryRow(ctx, getSearchProviderByName, name) + var i SearchProvider + err := row.Scan( + &i.ID, + &i.Name, + &i.Provider, + &i.Config, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const listSearchProviders = `-- name: ListSearchProviders :many +SELECT id, name, provider, config, created_at, updated_at FROM search_providers +ORDER BY created_at DESC +` + +func (q *Queries) ListSearchProviders(ctx context.Context) ([]SearchProvider, error) { + rows, err := q.db.Query(ctx, listSearchProviders) + if err != nil { + return nil, err + } + defer rows.Close() + var items []SearchProvider + for rows.Next() { + var i SearchProvider + if err := rows.Scan( + &i.ID, + &i.Name, + &i.Provider, + &i.Config, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const listSearchProvidersByProvider = `-- name: ListSearchProvidersByProvider :many +SELECT id, name, provider, config, created_at, updated_at FROM search_providers +WHERE provider = $1 +ORDER BY created_at DESC +` + +func (q *Queries) ListSearchProvidersByProvider(ctx context.Context, provider string) ([]SearchProvider, error) { + rows, err := q.db.Query(ctx, listSearchProvidersByProvider, provider) + if err != nil { + return nil, err + } + defer rows.Close() + var items []SearchProvider + for rows.Next() { + var i SearchProvider + if err := rows.Scan( + &i.ID, + &i.Name, + &i.Provider, + &i.Config, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const updateSearchProvider = `-- name: UpdateSearchProvider :one +UPDATE search_providers +SET + name = $1, + provider = $2, + config = $3, + updated_at = now() +WHERE id = $4 +RETURNING id, name, provider, config, created_at, updated_at +` + +type UpdateSearchProviderParams struct { + Name string `json:"name"` + Provider string `json:"provider"` + Config []byte `json:"config"` + ID pgtype.UUID `json:"id"` +} + +func (q *Queries) UpdateSearchProvider(ctx context.Context, arg UpdateSearchProviderParams) (SearchProvider, error) { + row := q.db.QueryRow(ctx, updateSearchProvider, + arg.Name, + arg.Provider, + arg.Config, + arg.ID, + ) + var i SearchProvider + err := row.Scan( + &i.ID, + &i.Name, + &i.Provider, + &i.Config, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} diff --git a/internal/db/sqlc/settings.sql.go b/internal/db/sqlc/settings.sql.go index c04b1562..9caec573 100644 --- a/internal/db/sqlc/settings.sql.go +++ b/internal/db/sqlc/settings.sql.go @@ -19,6 +19,7 @@ SET max_context_load_time = 1440, chat_model_id = NULL, memory_model_id = NULL, embedding_model_id = NULL, + search_provider_id = NULL, updated_at = now() WHERE id = $1 ` @@ -36,11 +37,13 @@ SELECT bots.allow_guest, chat_models.model_id AS chat_model_id, memory_models.model_id AS memory_model_id, - embedding_models.model_id AS embedding_model_id + embedding_models.model_id AS embedding_model_id, + search_providers.id::text AS search_provider_id FROM bots LEFT JOIN models AS chat_models ON chat_models.id = bots.chat_model_id LEFT JOIN models AS memory_models ON memory_models.id = bots.memory_model_id LEFT JOIN models AS embedding_models ON embedding_models.id = bots.embedding_model_id +LEFT JOIN search_providers ON search_providers.id = bots.search_provider_id WHERE bots.id = $1 ` @@ -52,6 +55,7 @@ type GetSettingsByBotIDRow struct { ChatModelID pgtype.Text `json:"chat_model_id"` MemoryModelID pgtype.Text `json:"memory_model_id"` EmbeddingModelID pgtype.Text `json:"embedding_model_id"` + SearchProviderID string `json:"search_provider_id"` } func (q *Queries) GetSettingsByBotID(ctx context.Context, id pgtype.UUID) (GetSettingsByBotIDRow, error) { @@ -65,6 +69,7 @@ func (q *Queries) GetSettingsByBotID(ctx context.Context, id pgtype.UUID) (GetSe &i.ChatModelID, &i.MemoryModelID, &i.EmbeddingModelID, + &i.SearchProviderID, ) return i, err } @@ -78,9 +83,10 @@ WITH updated AS ( chat_model_id = COALESCE($4::uuid, bots.chat_model_id), memory_model_id = COALESCE($5::uuid, bots.memory_model_id), embedding_model_id = COALESCE($6::uuid, bots.embedding_model_id), + search_provider_id = COALESCE($7::uuid, bots.search_provider_id), updated_at = now() - WHERE bots.id = $7 - RETURNING bots.id, bots.max_context_load_time, bots.language, bots.allow_guest, bots.chat_model_id, bots.memory_model_id, bots.embedding_model_id + WHERE bots.id = $8 + RETURNING bots.id, bots.max_context_load_time, bots.language, bots.allow_guest, bots.chat_model_id, bots.memory_model_id, bots.embedding_model_id, bots.search_provider_id ) SELECT updated.id AS bot_id, @@ -89,11 +95,13 @@ SELECT updated.allow_guest, chat_models.model_id AS chat_model_id, memory_models.model_id AS memory_model_id, - embedding_models.model_id AS embedding_model_id + embedding_models.model_id AS embedding_model_id, + search_providers.id::text AS search_provider_id FROM updated LEFT JOIN models AS chat_models ON chat_models.id = updated.chat_model_id LEFT JOIN models AS memory_models ON memory_models.id = updated.memory_model_id LEFT JOIN models AS embedding_models ON embedding_models.id = updated.embedding_model_id +LEFT JOIN search_providers ON search_providers.id = updated.search_provider_id ` type UpsertBotSettingsParams struct { @@ -103,6 +111,7 @@ type UpsertBotSettingsParams struct { ChatModelID pgtype.UUID `json:"chat_model_id"` MemoryModelID pgtype.UUID `json:"memory_model_id"` EmbeddingModelID pgtype.UUID `json:"embedding_model_id"` + SearchProviderID pgtype.UUID `json:"search_provider_id"` ID pgtype.UUID `json:"id"` } @@ -114,6 +123,7 @@ type UpsertBotSettingsRow struct { ChatModelID pgtype.Text `json:"chat_model_id"` MemoryModelID pgtype.Text `json:"memory_model_id"` EmbeddingModelID pgtype.Text `json:"embedding_model_id"` + SearchProviderID string `json:"search_provider_id"` } func (q *Queries) UpsertBotSettings(ctx context.Context, arg UpsertBotSettingsParams) (UpsertBotSettingsRow, error) { @@ -124,6 +134,7 @@ func (q *Queries) UpsertBotSettings(ctx context.Context, arg UpsertBotSettingsPa arg.ChatModelID, arg.MemoryModelID, arg.EmbeddingModelID, + arg.SearchProviderID, arg.ID, ) var i UpsertBotSettingsRow @@ -135,6 +146,7 @@ func (q *Queries) UpsertBotSettings(ctx context.Context, arg UpsertBotSettingsPa &i.ChatModelID, &i.MemoryModelID, &i.EmbeddingModelID, + &i.SearchProviderID, ) return i, err } diff --git a/internal/handlers/search_providers.go b/internal/handlers/search_providers.go new file mode 100644 index 00000000..9289fa8f --- /dev/null +++ b/internal/handlers/search_providers.go @@ -0,0 +1,163 @@ +package handlers + +import ( + "log/slog" + "net/http" + "strings" + + "github.com/labstack/echo/v4" + + "github.com/memohai/memoh/internal/searchproviders" +) + +type SearchProvidersHandler struct { + service *searchproviders.Service + logger *slog.Logger +} + +func NewSearchProvidersHandler(log *slog.Logger, service *searchproviders.Service) *SearchProvidersHandler { + return &SearchProvidersHandler{ + service: service, + logger: log.With(slog.String("handler", "search_providers")), + } +} + +func (h *SearchProvidersHandler) Register(e *echo.Echo) { + group := e.Group("/search-providers") + group.GET("/meta", h.ListMeta) + group.POST("", h.Create) + group.GET("", h.List) + group.GET("/:id", h.Get) + group.PUT("/:id", h.Update) + group.DELETE("/:id", h.Delete) +} + +// ListMeta godoc +// @Summary List search provider metadata +// @Description List available search provider types and config schemas +// @Tags search-providers +// @Success 200 {array} searchproviders.ProviderMeta +// @Router /search-providers/meta [get] +func (h *SearchProvidersHandler) ListMeta(c echo.Context) error { + return c.JSON(http.StatusOK, h.service.ListMeta(c.Request().Context())) +} + +// Create godoc +// @Summary Create a search provider +// @Description Create a search provider configuration +// @Tags search-providers +// @Accept json +// @Produce json +// @Param request body searchproviders.CreateRequest true "Search provider configuration" +// @Success 201 {object} searchproviders.GetResponse +// @Failure 400 {object} ErrorResponse +// @Failure 500 {object} ErrorResponse +// @Router /search-providers [post] +func (h *SearchProvidersHandler) Create(c echo.Context) error { + var req searchproviders.CreateRequest + if err := c.Bind(&req); err != nil { + return echo.NewHTTPError(http.StatusBadRequest, err.Error()) + } + if strings.TrimSpace(req.Name) == "" { + return echo.NewHTTPError(http.StatusBadRequest, "name is required") + } + if strings.TrimSpace(string(req.Provider)) == "" { + return echo.NewHTTPError(http.StatusBadRequest, "provider is required") + } + resp, err := h.service.Create(c.Request().Context(), req) + if err != nil { + return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) + } + return c.JSON(http.StatusCreated, resp) +} + +// List godoc +// @Summary List search providers +// @Description List configured search providers +// @Tags search-providers +// @Accept json +// @Produce json +// @Param provider query string false "Provider filter (brave)" +// @Success 200 {array} searchproviders.GetResponse +// @Failure 500 {object} ErrorResponse +// @Router /search-providers [get] +func (h *SearchProvidersHandler) List(c echo.Context) error { + items, err := h.service.List(c.Request().Context(), c.QueryParam("provider")) + if err != nil { + return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) + } + return c.JSON(http.StatusOK, items) +} + +// Get godoc +// @Summary Get a search provider +// @Description Get search provider by ID +// @Tags search-providers +// @Accept json +// @Produce json +// @Param id path string true "Provider ID" +// @Success 200 {object} searchproviders.GetResponse +// @Failure 400 {object} ErrorResponse +// @Failure 404 {object} ErrorResponse +// @Router /search-providers/{id} [get] +func (h *SearchProvidersHandler) Get(c echo.Context) error { + id := strings.TrimSpace(c.Param("id")) + if id == "" { + return echo.NewHTTPError(http.StatusBadRequest, "id is required") + } + resp, err := h.service.Get(c.Request().Context(), id) + if err != nil { + return echo.NewHTTPError(http.StatusNotFound, err.Error()) + } + return c.JSON(http.StatusOK, resp) +} + +// Update godoc +// @Summary Update a search provider +// @Description Update search provider by ID +// @Tags search-providers +// @Accept json +// @Produce json +// @Param id path string true "Provider ID" +// @Param request body searchproviders.UpdateRequest true "Updated configuration" +// @Success 200 {object} searchproviders.GetResponse +// @Failure 400 {object} ErrorResponse +// @Failure 500 {object} ErrorResponse +// @Router /search-providers/{id} [put] +func (h *SearchProvidersHandler) Update(c echo.Context) error { + id := strings.TrimSpace(c.Param("id")) + if id == "" { + return echo.NewHTTPError(http.StatusBadRequest, "id is required") + } + var req searchproviders.UpdateRequest + if err := c.Bind(&req); err != nil { + return echo.NewHTTPError(http.StatusBadRequest, err.Error()) + } + resp, err := h.service.Update(c.Request().Context(), id, req) + if err != nil { + return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) + } + return c.JSON(http.StatusOK, resp) +} + +// Delete godoc +// @Summary Delete a search provider +// @Description Delete search provider by ID +// @Tags search-providers +// @Accept json +// @Produce json +// @Param id path string true "Provider ID" +// @Success 204 "No Content" +// @Failure 400 {object} ErrorResponse +// @Failure 500 {object} ErrorResponse +// @Router /search-providers/{id} [delete] +func (h *SearchProvidersHandler) Delete(c echo.Context) error { + id := strings.TrimSpace(c.Param("id")) + if id == "" { + return echo.NewHTTPError(http.StatusBadRequest, "id is required") + } + if err := h.service.Delete(c.Request().Context(), id); err != nil { + return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) + } + return c.NoContent(http.StatusNoContent) +} diff --git a/internal/mcp/providers/web/provider.go b/internal/mcp/providers/web/provider.go new file mode 100644 index 00000000..d568d670 --- /dev/null +++ b/internal/mcp/providers/web/provider.go @@ -0,0 +1,211 @@ +package web + +import ( + "context" + "encoding/json" + "fmt" + "io" + "log/slog" + "net/http" + "net/url" + "strings" + "time" + + mcpgw "github.com/memohai/memoh/internal/mcp" + "github.com/memohai/memoh/internal/searchproviders" + "github.com/memohai/memoh/internal/settings" +) + +const ( + toolWebSearch = "web_search" +) + +type Executor struct { + logger *slog.Logger + settings *settings.Service + searchProviders *searchproviders.Service +} + +func NewExecutor(log *slog.Logger, settingsSvc *settings.Service, searchSvc *searchproviders.Service) *Executor { + if log == nil { + log = slog.Default() + } + return &Executor{ + logger: log.With(slog.String("provider", "web_tool")), + settings: settingsSvc, + searchProviders: searchSvc, + } +} + +func (p *Executor) ListTools(ctx context.Context, session mcpgw.ToolSessionContext) ([]mcpgw.ToolDescriptor, error) { + if p.settings == nil || p.searchProviders == nil { + return []mcpgw.ToolDescriptor{}, nil + } + return []mcpgw.ToolDescriptor{ + { + Name: toolWebSearch, + Description: "Search web results via configured search provider.", + InputSchema: map[string]any{ + "type": "object", + "properties": map[string]any{ + "query": map[string]any{"type": "string", "description": "Search query"}, + "count": map[string]any{"type": "integer", "description": "Number of results, default 5"}, + }, + "required": []string{"query"}, + }, + }, + }, nil +} + +func (p *Executor) CallTool(ctx context.Context, session mcpgw.ToolSessionContext, toolName string, arguments map[string]any) (map[string]any, error) { + if p.settings == nil || p.searchProviders == nil { + return mcpgw.BuildToolErrorResult("web tools are not available"), nil + } + botID := strings.TrimSpace(session.BotID) + if botID == "" { + return mcpgw.BuildToolErrorResult("bot_id is required"), nil + } + botSettings, err := p.settings.GetBot(ctx, botID) + if err != nil { + return mcpgw.BuildToolErrorResult(err.Error()), nil + } + searchProviderID := strings.TrimSpace(botSettings.SearchProviderID) + if searchProviderID == "" { + return mcpgw.BuildToolErrorResult("search provider not configured for this bot"), nil + } + provider, err := p.searchProviders.GetRawByID(ctx, searchProviderID) + if err != nil { + return mcpgw.BuildToolErrorResult(err.Error()), nil + } + + switch toolName { + case toolWebSearch: + return p.callWebSearch(ctx, provider.Provider, provider.Config, arguments) + default: + return nil, mcpgw.ErrToolNotFound + } +} + +func (p *Executor) callWebSearch(ctx context.Context, providerName string, configJSON []byte, arguments map[string]any) (map[string]any, error) { + query := strings.TrimSpace(mcpgw.StringArg(arguments, "query")) + if query == "" { + return mcpgw.BuildToolErrorResult("query is required"), nil + } + count := 5 + if value, ok, err := mcpgw.IntArg(arguments, "count"); err != nil { + return mcpgw.BuildToolErrorResult(err.Error()), nil + } else if ok && value > 0 { + count = value + } + if count > 20 { + count = 20 + } + + if strings.TrimSpace(providerName) != string(searchproviders.ProviderBrave) { + return mcpgw.BuildToolErrorResult("unsupported search provider"), nil + } + cfg := parseConfig(configJSON) + endpoint := strings.TrimRight(firstNonEmpty(stringValue(cfg["base_url"]), "https://api.search.brave.com/res/v1/web/search"), "/") + reqURL, err := url.Parse(endpoint) + if err != nil { + return mcpgw.BuildToolErrorResult("invalid search provider base_url"), nil + } + params := reqURL.Query() + params.Set("q", query) + params.Set("count", fmt.Sprintf("%d", count)) + reqURL.RawQuery = params.Encode() + + timeout := parseTimeout(configJSON, 15*time.Second) + client := &http.Client{Timeout: timeout} + req, err := http.NewRequestWithContext(ctx, http.MethodGet, reqURL.String(), nil) + if err != nil { + return mcpgw.BuildToolErrorResult(err.Error()), nil + } + req.Header.Set("Accept", "application/json") + apiKey := stringValue(cfg["api_key"]) + if strings.TrimSpace(apiKey) != "" { + req.Header.Set("X-Subscription-Token", strings.TrimSpace(apiKey)) + } + resp, err := client.Do(req) + if err != nil { + return mcpgw.BuildToolErrorResult(err.Error()), nil + } + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + if err != nil { + return mcpgw.BuildToolErrorResult(err.Error()), nil + } + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return mcpgw.BuildToolErrorResult("search request failed"), nil + } + var raw struct { + Web struct { + Results []struct { + Title string `json:"title"` + URL string `json:"url"` + Description string `json:"description"` + } `json:"results"` + } `json:"web"` + } + if err := json.Unmarshal(body, &raw); err != nil { + return mcpgw.BuildToolErrorResult("invalid search response"), nil + } + results := make([]map[string]any, 0, len(raw.Web.Results)) + for _, item := range raw.Web.Results { + results = append(results, map[string]any{ + "title": item.Title, + "url": item.URL, + "description": item.Description, + }) + } + return mcpgw.BuildToolSuccessResult(map[string]any{ + "query": query, + "results": results, + }), nil +} + +func parseTimeout(configJSON []byte, fallback time.Duration) time.Duration { + cfg := parseConfig(configJSON) + raw, ok := cfg["timeout_seconds"] + if !ok { + return fallback + } + switch value := raw.(type) { + case float64: + if value > 0 { + return time.Duration(value * float64(time.Second)) + } + case int: + if value > 0 { + return time.Duration(value) * time.Second + } + } + return fallback +} + +func parseConfig(configJSON []byte) map[string]any { + if len(configJSON) == 0 { + return map[string]any{} + } + var cfg map[string]any + if err := json.Unmarshal(configJSON, &cfg); err != nil || cfg == nil { + return map[string]any{} + } + return cfg +} + +func stringValue(raw any) string { + if value, ok := raw.(string); ok { + return strings.TrimSpace(value) + } + return "" +} + +func firstNonEmpty(values ...string) string { + for _, value := range values { + if strings.TrimSpace(value) != "" { + return strings.TrimSpace(value) + } + } + return "" +} diff --git a/internal/searchproviders/service.go b/internal/searchproviders/service.go new file mode 100644 index 00000000..5bd724f0 --- /dev/null +++ b/internal/searchproviders/service.go @@ -0,0 +1,191 @@ +package searchproviders + +import ( + "context" + "encoding/json" + "fmt" + "log/slog" + "strings" + + "github.com/memohai/memoh/internal/db" + "github.com/memohai/memoh/internal/db/sqlc" +) + +type Service struct { + queries *sqlc.Queries + logger *slog.Logger +} + +func NewService(log *slog.Logger, queries *sqlc.Queries) *Service { + return &Service{ + queries: queries, + logger: log.With(slog.String("service", "search_providers")), + } +} + +func (s *Service) ListMeta(_ context.Context) []ProviderMeta { + return []ProviderMeta{ + { + Provider: string(ProviderBrave), + DisplayName: "Brave", + ConfigSchema: ProviderConfigSchema{ + Fields: map[string]ProviderFieldSchema{ + "api_key": { + Type: "secret", + Title: "API Key", + Description: "Brave Search API key", + Required: true, + }, + "base_url": { + Type: "string", + Title: "Base URL", + Description: "Brave API base URL", + Required: false, + Example: "https://api.search.brave.com/res/v1/web/search", + }, + "timeout_seconds": { + Type: "number", + Title: "Timeout (seconds)", + Description: "HTTP timeout in seconds", + Required: false, + Example: 15, + }, + }, + }, + }, + } +} + +func (s *Service) Create(ctx context.Context, req CreateRequest) (GetResponse, error) { + if !isValidProviderName(req.Provider) { + return GetResponse{}, fmt.Errorf("invalid provider: %s", req.Provider) + } + configJSON, err := json.Marshal(req.Config) + if err != nil { + return GetResponse{}, fmt.Errorf("marshal config: %w", err) + } + row, err := s.queries.CreateSearchProvider(ctx, sqlc.CreateSearchProviderParams{ + Name: strings.TrimSpace(req.Name), + Provider: string(req.Provider), + Config: configJSON, + }) + if err != nil { + return GetResponse{}, fmt.Errorf("create search provider: %w", err) + } + return s.toGetResponse(row), nil +} + +func (s *Service) Get(ctx context.Context, id string) (GetResponse, error) { + pgID, err := db.ParseUUID(id) + if err != nil { + return GetResponse{}, err + } + row, err := s.queries.GetSearchProviderByID(ctx, pgID) + if err != nil { + return GetResponse{}, fmt.Errorf("get search provider: %w", err) + } + return s.toGetResponse(row), nil +} + +func (s *Service) GetRawByID(ctx context.Context, id string) (sqlc.SearchProvider, error) { + pgID, err := db.ParseUUID(id) + if err != nil { + return sqlc.SearchProvider{}, err + } + return s.queries.GetSearchProviderByID(ctx, pgID) +} + +func (s *Service) List(ctx context.Context, provider string) ([]GetResponse, error) { + provider = strings.TrimSpace(provider) + var ( + rows []sqlc.SearchProvider + err error + ) + if provider == "" { + rows, err = s.queries.ListSearchProviders(ctx) + } else { + rows, err = s.queries.ListSearchProvidersByProvider(ctx, provider) + } + if err != nil { + return nil, fmt.Errorf("list search providers: %w", err) + } + items := make([]GetResponse, 0, len(rows)) + for _, row := range rows { + items = append(items, s.toGetResponse(row)) + } + return items, nil +} + +func (s *Service) Update(ctx context.Context, id string, req UpdateRequest) (GetResponse, error) { + pgID, err := db.ParseUUID(id) + if err != nil { + return GetResponse{}, err + } + current, err := s.queries.GetSearchProviderByID(ctx, pgID) + if err != nil { + return GetResponse{}, fmt.Errorf("get search provider: %w", err) + } + name := current.Name + if req.Name != nil { + name = strings.TrimSpace(*req.Name) + } + provider := current.Provider + if req.Provider != nil { + if !isValidProviderName(*req.Provider) { + return GetResponse{}, fmt.Errorf("invalid provider: %s", *req.Provider) + } + provider = string(*req.Provider) + } + config := current.Config + if req.Config != nil { + configJSON, marshalErr := json.Marshal(req.Config) + if marshalErr != nil { + return GetResponse{}, fmt.Errorf("marshal config: %w", marshalErr) + } + config = configJSON + } + updated, err := s.queries.UpdateSearchProvider(ctx, sqlc.UpdateSearchProviderParams{ + ID: pgID, + Name: name, + Provider: provider, + Config: config, + }) + if err != nil { + return GetResponse{}, fmt.Errorf("update search provider: %w", err) + } + return s.toGetResponse(updated), nil +} + +func (s *Service) Delete(ctx context.Context, id string) error { + pgID, err := db.ParseUUID(id) + if err != nil { + return err + } + return s.queries.DeleteSearchProvider(ctx, pgID) +} + +func (s *Service) toGetResponse(row sqlc.SearchProvider) GetResponse { + var cfg map[string]any + if len(row.Config) > 0 { + if err := json.Unmarshal(row.Config, &cfg); err != nil { + s.logger.Warn("search provider config unmarshal failed", slog.String("id", row.ID.String()), slog.Any("error", err)) + } + } + return GetResponse{ + ID: row.ID.String(), + Name: row.Name, + Provider: row.Provider, + Config: cfg, + CreatedAt: row.CreatedAt.Time, + UpdatedAt: row.UpdatedAt.Time, + } +} + +func isValidProviderName(name ProviderName) bool { + switch name { + case ProviderBrave: + return true + default: + return false + } +} diff --git a/internal/searchproviders/types.go b/internal/searchproviders/types.go new file mode 100644 index 00000000..d00e86c1 --- /dev/null +++ b/internal/searchproviders/types.go @@ -0,0 +1,49 @@ +package searchproviders + +import "time" + +type ProviderName string + +const ( + ProviderBrave ProviderName = "brave" +) + +type ProviderConfigSchema struct { + Fields map[string]ProviderFieldSchema `json:"fields"` +} + +type ProviderFieldSchema struct { + Type string `json:"type"` + Title string `json:"title,omitempty"` + Description string `json:"description,omitempty"` + Required bool `json:"required,omitempty"` + Enum []string `json:"enum,omitempty"` + Example any `json:"example,omitempty"` +} + +type ProviderMeta struct { + Provider string `json:"provider"` + DisplayName string `json:"display_name"` + ConfigSchema ProviderConfigSchema `json:"config_schema"` +} + +type CreateRequest struct { + Name string `json:"name"` + Provider ProviderName `json:"provider"` + Config map[string]any `json:"config,omitempty"` +} + +type UpdateRequest struct { + Name *string `json:"name,omitempty"` + Provider *ProviderName `json:"provider,omitempty"` + Config map[string]any `json:"config,omitempty"` +} + +type GetResponse struct { + ID string `json:"id"` + Name string `json:"name"` + Provider string `json:"provider"` + Config map[string]any `json:"config,omitempty"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` +} diff --git a/internal/settings/service.go b/internal/settings/service.go index fe2cc406..751db3da 100644 --- a/internal/settings/service.go +++ b/internal/settings/service.go @@ -93,6 +93,14 @@ func (s *Service) UpsertBot(ctx context.Context, botID string, req UpsertRequest } embeddingModelUUID = modelID } + searchProviderUUID := pgtype.UUID{} + if value := strings.TrimSpace(req.SearchProviderID); value != "" { + providerID, err := db.ParseUUID(value) + if err != nil { + return Settings{}, err + } + searchProviderUUID = providerID + } updated, err := s.queries.UpsertBotSettings(ctx, sqlc.UpsertBotSettingsParams{ ID: pgID, @@ -102,6 +110,7 @@ func (s *Service) UpsertBot(ctx context.Context, botID string, req UpsertRequest ChatModelID: chatModelUUID, MemoryModelID: memoryModelUUID, EmbeddingModelID: embeddingModelUUID, + SearchProviderID: searchProviderUUID, }) if err != nil { return Settings{}, err @@ -143,6 +152,7 @@ func normalizeBotSettingsReadRow(row sqlc.GetSettingsByBotIDRow) Settings { row.ChatModelID, row.MemoryModelID, row.EmbeddingModelID, + row.SearchProviderID, ) } @@ -154,6 +164,7 @@ func normalizeBotSettingsWriteRow(row sqlc.UpsertBotSettingsRow) Settings { row.ChatModelID, row.MemoryModelID, row.EmbeddingModelID, + row.SearchProviderID, ) } @@ -164,11 +175,13 @@ func normalizeBotSettingsFields( chatModelID pgtype.Text, memoryModelID pgtype.Text, embeddingModelID pgtype.Text, + searchProviderID string, ) Settings { settings := normalizeBotSetting(maxContextLoadTime, language, allowGuest) settings.ChatModelID = strings.TrimSpace(chatModelID.String) settings.MemoryModelID = strings.TrimSpace(memoryModelID.String) settings.EmbeddingModelID = strings.TrimSpace(embeddingModelID.String) + settings.SearchProviderID = strings.TrimSpace(searchProviderID) return settings } diff --git a/internal/settings/types.go b/internal/settings/types.go index f750f8ff..33c6dc66 100644 --- a/internal/settings/types.go +++ b/internal/settings/types.go @@ -9,6 +9,7 @@ type Settings struct { ChatModelID string `json:"chat_model_id"` MemoryModelID string `json:"memory_model_id"` EmbeddingModelID string `json:"embedding_model_id"` + SearchProviderID string `json:"search_provider_id"` MaxContextLoadTime int `json:"max_context_load_time"` Language string `json:"language"` AllowGuest bool `json:"allow_guest"` @@ -18,6 +19,7 @@ type UpsertRequest struct { ChatModelID string `json:"chat_model_id,omitempty"` MemoryModelID string `json:"memory_model_id,omitempty"` EmbeddingModelID string `json:"embedding_model_id,omitempty"` + SearchProviderID string `json:"search_provider_id,omitempty"` MaxContextLoadTime *int `json:"max_context_load_time,omitempty"` Language string `json:"language,omitempty"` AllowGuest *bool `json:"allow_guest,omitempty"` diff --git a/packages/config/src/types.ts b/packages/config/src/types.ts index 62eece8b..cff45061 100644 --- a/packages/config/src/types.ts +++ b/packages/config/src/types.ts @@ -9,7 +9,6 @@ export interface Config { qdrant: QdrantConfig; agent_gateway: AgentGatewayConfig; web: WebConfig; - brave: BraveConfig; } export interface LogConfig { @@ -70,7 +69,3 @@ export interface WebConfig { port: number; } -export interface BraveConfig { - api_key: string; - base_url: string; -} diff --git a/packages/sdk/src/@pinia/colada.gen.ts b/packages/sdk/src/@pinia/colada.gen.ts index 347e55b5..c40da7c8 100644 --- a/packages/sdk/src/@pinia/colada.gen.ts +++ b/packages/sdk/src/@pinia/colada.gen.ts @@ -4,8 +4,8 @@ import { type _JSONValue, defineQueryOptions, type UseMutationOptions } from '@p import { serializeQueryKeyValue } from '../client'; import { client } from '../client.gen'; -import { deleteBotsByBotIdContainer, deleteBotsByBotIdContainerSkills, deleteBotsByBotIdMcpById, deleteBotsByBotIdMemory, deleteBotsByBotIdMemoryById, deleteBotsByBotIdScheduleById, deleteBotsByBotIdSettings, deleteBotsByBotIdSubagentsById, deleteBotsById, deleteBotsByIdMembersByUserId, deleteModelsById, deleteModelsModelByModelId, deleteProvidersById, getBots, getBotsByBotIdContainer, getBotsByBotIdContainerSkills, getBotsByBotIdContainerSnapshots, getBotsByBotIdMcp, getBotsByBotIdMcpById, getBotsByBotIdMcpExport, getBotsByBotIdMemory, getBotsByBotIdMemoryUsage, getBotsByBotIdMessages, getBotsByBotIdSchedule, getBotsByBotIdScheduleById, getBotsByBotIdSettings, getBotsByBotIdSubagents, getBotsByBotIdSubagentsById, getBotsByBotIdSubagentsByIdContext, getBotsByBotIdSubagentsByIdSkills, getBotsById, getBotsByIdChannelByPlatform, getBotsByIdChecks, getBotsByIdChecksKeys, getBotsByIdChecksRunByKey, getBotsByIdMembers, getChannels, getChannelsByPlatform, getModels, getModelsById, getModelsCount, getModelsModelByModelId, getProviders, getProvidersById, getProvidersByIdModels, getProvidersCount, getProvidersNameByName, getUsers, getUsersById, getUsersMe, getUsersMeChannelsByPlatform, getUsersMeIdentities, type Options, postAuthLogin, postBots, postBotsByBotIdContainer, postBotsByBotIdContainerSkills, postBotsByBotIdContainerSnapshots, postBotsByBotIdContainerStart, postBotsByBotIdContainerStop, postBotsByBotIdMcp, postBotsByBotIdMcpOpsBatchDelete, postBotsByBotIdMcpStdio, postBotsByBotIdMcpStdioByConnectionId, postBotsByBotIdMemory, postBotsByBotIdMemoryCompact, postBotsByBotIdMemoryRebuild, postBotsByBotIdMemorySearch, postBotsByBotIdSchedule, postBotsByBotIdSettings, postBotsByBotIdSubagents, postBotsByBotIdSubagentsByIdSkills, postBotsByBotIdTools, postBotsByIdChannelByPlatformSend, postBotsByIdChannelByPlatformSendChat, postEmbeddings, postModels, postProviders, postUsers, putBotsByBotIdMcpById, putBotsByBotIdMcpImport, putBotsByBotIdScheduleById, putBotsByBotIdSettings, putBotsByBotIdSubagentsById, putBotsByBotIdSubagentsByIdContext, putBotsByBotIdSubagentsByIdSkills, putBotsById, putBotsByIdChannelByPlatform, putBotsByIdMembers, putBotsByIdOwner, putModelsById, putModelsModelByModelId, putProvidersById, putUsersById, putUsersByIdPassword, putUsersMe, putUsersMeChannelsByPlatform, putUsersMePassword } from '../sdk.gen'; -import type { DeleteBotsByBotIdContainerData, DeleteBotsByBotIdContainerError, DeleteBotsByBotIdContainerSkillsData, DeleteBotsByBotIdContainerSkillsError, DeleteBotsByBotIdContainerSkillsResponse, DeleteBotsByBotIdMcpByIdData, DeleteBotsByBotIdMcpByIdError, DeleteBotsByBotIdMemoryByIdData, DeleteBotsByBotIdMemoryByIdError, DeleteBotsByBotIdMemoryByIdResponse, DeleteBotsByBotIdMemoryData, DeleteBotsByBotIdMemoryError, DeleteBotsByBotIdMemoryResponse, DeleteBotsByBotIdScheduleByIdData, DeleteBotsByBotIdScheduleByIdError, DeleteBotsByBotIdSettingsData, DeleteBotsByBotIdSettingsError, DeleteBotsByBotIdSubagentsByIdData, DeleteBotsByBotIdSubagentsByIdError, DeleteBotsByIdData, DeleteBotsByIdError, DeleteBotsByIdMembersByUserIdData, DeleteBotsByIdMembersByUserIdError, DeleteBotsByIdResponse, DeleteModelsByIdData, DeleteModelsByIdError, DeleteModelsModelByModelIdData, DeleteModelsModelByModelIdError, DeleteProvidersByIdData, DeleteProvidersByIdError, GetBotsByBotIdContainerData, GetBotsByBotIdContainerSkillsData, GetBotsByBotIdContainerSnapshotsData, GetBotsByBotIdMcpByIdData, GetBotsByBotIdMcpData, GetBotsByBotIdMcpExportData, GetBotsByBotIdMemoryData, GetBotsByBotIdMemoryUsageData, GetBotsByBotIdMessagesData, GetBotsByBotIdScheduleByIdData, GetBotsByBotIdScheduleData, GetBotsByBotIdSettingsData, GetBotsByBotIdSubagentsByIdContextData, GetBotsByBotIdSubagentsByIdData, GetBotsByBotIdSubagentsByIdSkillsData, GetBotsByBotIdSubagentsData, GetBotsByIdChannelByPlatformData, GetBotsByIdChecksData, GetBotsByIdChecksKeysData, GetBotsByIdChecksRunByKeyData, GetBotsByIdData, GetBotsByIdMembersData, GetBotsData, GetChannelsByPlatformData, GetChannelsData, GetModelsByIdData, GetModelsCountData, GetModelsData, GetModelsModelByModelIdData, GetProvidersByIdData, GetProvidersByIdModelsData, GetProvidersCountData, GetProvidersData, GetProvidersNameByNameData, GetUsersByIdData, GetUsersData, GetUsersMeChannelsByPlatformData, GetUsersMeData, GetUsersMeIdentitiesData, PostAuthLoginData, PostAuthLoginError, PostAuthLoginResponse, PostBotsByBotIdContainerData, PostBotsByBotIdContainerError, PostBotsByBotIdContainerResponse, PostBotsByBotIdContainerSkillsData, PostBotsByBotIdContainerSkillsError, PostBotsByBotIdContainerSkillsResponse, PostBotsByBotIdContainerSnapshotsData, PostBotsByBotIdContainerSnapshotsError, PostBotsByBotIdContainerSnapshotsResponse, PostBotsByBotIdContainerStartData, PostBotsByBotIdContainerStartError, PostBotsByBotIdContainerStartResponse, PostBotsByBotIdContainerStopData, PostBotsByBotIdContainerStopError, PostBotsByBotIdContainerStopResponse, PostBotsByBotIdMcpData, PostBotsByBotIdMcpError, PostBotsByBotIdMcpOpsBatchDeleteData, PostBotsByBotIdMcpOpsBatchDeleteError, PostBotsByBotIdMcpResponse, PostBotsByBotIdMcpStdioByConnectionIdData, PostBotsByBotIdMcpStdioByConnectionIdError, PostBotsByBotIdMcpStdioByConnectionIdResponse, PostBotsByBotIdMcpStdioData, PostBotsByBotIdMcpStdioError, PostBotsByBotIdMcpStdioResponse, PostBotsByBotIdMemoryCompactData, PostBotsByBotIdMemoryCompactError, PostBotsByBotIdMemoryCompactResponse, PostBotsByBotIdMemoryData, PostBotsByBotIdMemoryError, PostBotsByBotIdMemoryRebuildData, PostBotsByBotIdMemoryRebuildError, PostBotsByBotIdMemoryRebuildResponse, PostBotsByBotIdMemoryResponse, PostBotsByBotIdMemorySearchData, PostBotsByBotIdMemorySearchError, PostBotsByBotIdMemorySearchResponse, PostBotsByBotIdScheduleData, PostBotsByBotIdScheduleError, PostBotsByBotIdScheduleResponse, PostBotsByBotIdSettingsData, PostBotsByBotIdSettingsError, PostBotsByBotIdSettingsResponse, PostBotsByBotIdSubagentsByIdSkillsData, PostBotsByBotIdSubagentsByIdSkillsError, PostBotsByBotIdSubagentsByIdSkillsResponse, PostBotsByBotIdSubagentsData, PostBotsByBotIdSubagentsError, PostBotsByBotIdSubagentsResponse, PostBotsByBotIdToolsData, PostBotsByBotIdToolsError, PostBotsByBotIdToolsResponse, PostBotsByIdChannelByPlatformSendChatData, PostBotsByIdChannelByPlatformSendChatError, PostBotsByIdChannelByPlatformSendChatResponse, PostBotsByIdChannelByPlatformSendData, PostBotsByIdChannelByPlatformSendError, PostBotsByIdChannelByPlatformSendResponse, PostBotsData, PostBotsError, PostBotsResponse, PostEmbeddingsData, PostEmbeddingsError, PostEmbeddingsResponse, PostModelsData, PostModelsError, PostModelsResponse, PostProvidersData, PostProvidersError, PostProvidersResponse, PostUsersData, PostUsersError, PostUsersResponse, PutBotsByBotIdMcpByIdData, PutBotsByBotIdMcpByIdError, PutBotsByBotIdMcpByIdResponse, PutBotsByBotIdMcpImportData, PutBotsByBotIdMcpImportError, PutBotsByBotIdMcpImportResponse, PutBotsByBotIdScheduleByIdData, PutBotsByBotIdScheduleByIdError, PutBotsByBotIdScheduleByIdResponse, PutBotsByBotIdSettingsData, PutBotsByBotIdSettingsError, PutBotsByBotIdSettingsResponse, PutBotsByBotIdSubagentsByIdContextData, PutBotsByBotIdSubagentsByIdContextError, PutBotsByBotIdSubagentsByIdContextResponse, PutBotsByBotIdSubagentsByIdData, PutBotsByBotIdSubagentsByIdError, PutBotsByBotIdSubagentsByIdResponse, PutBotsByBotIdSubagentsByIdSkillsData, PutBotsByBotIdSubagentsByIdSkillsError, PutBotsByBotIdSubagentsByIdSkillsResponse, PutBotsByIdChannelByPlatformData, PutBotsByIdChannelByPlatformError, PutBotsByIdChannelByPlatformResponse, PutBotsByIdData, PutBotsByIdError, PutBotsByIdMembersData, PutBotsByIdMembersError, PutBotsByIdMembersResponse, PutBotsByIdOwnerData, PutBotsByIdOwnerError, PutBotsByIdOwnerResponse, PutBotsByIdResponse, PutModelsByIdData, PutModelsByIdError, PutModelsByIdResponse, PutModelsModelByModelIdData, PutModelsModelByModelIdError, PutModelsModelByModelIdResponse, PutProvidersByIdData, PutProvidersByIdError, PutProvidersByIdResponse, PutUsersByIdData, PutUsersByIdError, PutUsersByIdPasswordData, PutUsersByIdPasswordError, PutUsersByIdResponse, PutUsersMeChannelsByPlatformData, PutUsersMeChannelsByPlatformError, PutUsersMeChannelsByPlatformResponse, PutUsersMeData, PutUsersMeError, PutUsersMePasswordData, PutUsersMePasswordError, PutUsersMeResponse } from '../types.gen'; +import { deleteBotsByBotIdContainer, deleteBotsByBotIdContainerSkills, deleteBotsByBotIdMcpById, deleteBotsByBotIdMemory, deleteBotsByBotIdMemoryById, deleteBotsByBotIdScheduleById, deleteBotsByBotIdSettings, deleteBotsByBotIdSubagentsById, deleteBotsById, deleteBotsByIdMembersByUserId, deleteModelsById, deleteModelsModelByModelId, deleteProvidersById, deleteSearchProvidersById, getBots, getBotsByBotIdContainer, getBotsByBotIdContainerSkills, getBotsByBotIdContainerSnapshots, getBotsByBotIdMcp, getBotsByBotIdMcpById, getBotsByBotIdMcpExport, getBotsByBotIdMemory, getBotsByBotIdMemoryUsage, getBotsByBotIdMessages, getBotsByBotIdSchedule, getBotsByBotIdScheduleById, getBotsByBotIdSettings, getBotsByBotIdSubagents, getBotsByBotIdSubagentsById, getBotsByBotIdSubagentsByIdContext, getBotsByBotIdSubagentsByIdSkills, getBotsById, getBotsByIdChannelByPlatform, getBotsByIdChecks, getBotsByIdChecksKeys, getBotsByIdChecksRunByKey, getBotsByIdMembers, getChannels, getChannelsByPlatform, getModels, getModelsById, getModelsCount, getModelsModelByModelId, getProviders, getProvidersById, getProvidersByIdModels, getProvidersCount, getProvidersNameByName, getSearchProviders, getSearchProvidersById, getSearchProvidersMeta, getUsers, getUsersById, getUsersMe, getUsersMeChannelsByPlatform, getUsersMeIdentities, type Options, postAuthLogin, postBots, postBotsByBotIdContainer, postBotsByBotIdContainerSkills, postBotsByBotIdContainerSnapshots, postBotsByBotIdContainerStart, postBotsByBotIdContainerStop, postBotsByBotIdMcp, postBotsByBotIdMcpOpsBatchDelete, postBotsByBotIdMcpStdio, postBotsByBotIdMcpStdioByConnectionId, postBotsByBotIdMemory, postBotsByBotIdMemoryCompact, postBotsByBotIdMemoryRebuild, postBotsByBotIdMemorySearch, postBotsByBotIdSchedule, postBotsByBotIdSettings, postBotsByBotIdSubagents, postBotsByBotIdSubagentsByIdSkills, postBotsByBotIdTools, postBotsByIdChannelByPlatformSend, postBotsByIdChannelByPlatformSendChat, postEmbeddings, postModels, postProviders, postSearchProviders, postUsers, putBotsByBotIdMcpById, putBotsByBotIdMcpImport, putBotsByBotIdScheduleById, putBotsByBotIdSettings, putBotsByBotIdSubagentsById, putBotsByBotIdSubagentsByIdContext, putBotsByBotIdSubagentsByIdSkills, putBotsById, putBotsByIdChannelByPlatform, putBotsByIdMembers, putBotsByIdOwner, putModelsById, putModelsModelByModelId, putProvidersById, putSearchProvidersById, putUsersById, putUsersByIdPassword, putUsersMe, putUsersMeChannelsByPlatform, putUsersMePassword } from '../sdk.gen'; +import type { DeleteBotsByBotIdContainerData, DeleteBotsByBotIdContainerError, DeleteBotsByBotIdContainerSkillsData, DeleteBotsByBotIdContainerSkillsError, DeleteBotsByBotIdContainerSkillsResponse, DeleteBotsByBotIdMcpByIdData, DeleteBotsByBotIdMcpByIdError, DeleteBotsByBotIdMemoryByIdData, DeleteBotsByBotIdMemoryByIdError, DeleteBotsByBotIdMemoryByIdResponse, DeleteBotsByBotIdMemoryData, DeleteBotsByBotIdMemoryError, DeleteBotsByBotIdMemoryResponse, DeleteBotsByBotIdScheduleByIdData, DeleteBotsByBotIdScheduleByIdError, DeleteBotsByBotIdSettingsData, DeleteBotsByBotIdSettingsError, DeleteBotsByBotIdSubagentsByIdData, DeleteBotsByBotIdSubagentsByIdError, DeleteBotsByIdData, DeleteBotsByIdError, DeleteBotsByIdMembersByUserIdData, DeleteBotsByIdMembersByUserIdError, DeleteBotsByIdResponse, DeleteModelsByIdData, DeleteModelsByIdError, DeleteModelsModelByModelIdData, DeleteModelsModelByModelIdError, DeleteProvidersByIdData, DeleteProvidersByIdError, DeleteSearchProvidersByIdData, DeleteSearchProvidersByIdError, GetBotsByBotIdContainerData, GetBotsByBotIdContainerSkillsData, GetBotsByBotIdContainerSnapshotsData, GetBotsByBotIdMcpByIdData, GetBotsByBotIdMcpData, GetBotsByBotIdMcpExportData, GetBotsByBotIdMemoryData, GetBotsByBotIdMemoryUsageData, GetBotsByBotIdMessagesData, GetBotsByBotIdScheduleByIdData, GetBotsByBotIdScheduleData, GetBotsByBotIdSettingsData, GetBotsByBotIdSubagentsByIdContextData, GetBotsByBotIdSubagentsByIdData, GetBotsByBotIdSubagentsByIdSkillsData, GetBotsByBotIdSubagentsData, GetBotsByIdChannelByPlatformData, GetBotsByIdChecksData, GetBotsByIdChecksKeysData, GetBotsByIdChecksRunByKeyData, GetBotsByIdData, GetBotsByIdMembersData, GetBotsData, GetChannelsByPlatformData, GetChannelsData, GetModelsByIdData, GetModelsCountData, GetModelsData, GetModelsModelByModelIdData, GetProvidersByIdData, GetProvidersByIdModelsData, GetProvidersCountData, GetProvidersData, GetProvidersNameByNameData, GetSearchProvidersByIdData, GetSearchProvidersData, GetSearchProvidersMetaData, GetUsersByIdData, GetUsersData, GetUsersMeChannelsByPlatformData, GetUsersMeData, GetUsersMeIdentitiesData, PostAuthLoginData, PostAuthLoginError, PostAuthLoginResponse, PostBotsByBotIdContainerData, PostBotsByBotIdContainerError, PostBotsByBotIdContainerResponse, PostBotsByBotIdContainerSkillsData, PostBotsByBotIdContainerSkillsError, PostBotsByBotIdContainerSkillsResponse, PostBotsByBotIdContainerSnapshotsData, PostBotsByBotIdContainerSnapshotsError, PostBotsByBotIdContainerSnapshotsResponse, PostBotsByBotIdContainerStartData, PostBotsByBotIdContainerStartError, PostBotsByBotIdContainerStartResponse, PostBotsByBotIdContainerStopData, PostBotsByBotIdContainerStopError, PostBotsByBotIdContainerStopResponse, PostBotsByBotIdMcpData, PostBotsByBotIdMcpError, PostBotsByBotIdMcpOpsBatchDeleteData, PostBotsByBotIdMcpOpsBatchDeleteError, PostBotsByBotIdMcpResponse, PostBotsByBotIdMcpStdioByConnectionIdData, PostBotsByBotIdMcpStdioByConnectionIdError, PostBotsByBotIdMcpStdioByConnectionIdResponse, PostBotsByBotIdMcpStdioData, PostBotsByBotIdMcpStdioError, PostBotsByBotIdMcpStdioResponse, PostBotsByBotIdMemoryCompactData, PostBotsByBotIdMemoryCompactError, PostBotsByBotIdMemoryCompactResponse, PostBotsByBotIdMemoryData, PostBotsByBotIdMemoryError, PostBotsByBotIdMemoryRebuildData, PostBotsByBotIdMemoryRebuildError, PostBotsByBotIdMemoryRebuildResponse, PostBotsByBotIdMemoryResponse, PostBotsByBotIdMemorySearchData, PostBotsByBotIdMemorySearchError, PostBotsByBotIdMemorySearchResponse, PostBotsByBotIdScheduleData, PostBotsByBotIdScheduleError, PostBotsByBotIdScheduleResponse, PostBotsByBotIdSettingsData, PostBotsByBotIdSettingsError, PostBotsByBotIdSettingsResponse, PostBotsByBotIdSubagentsByIdSkillsData, PostBotsByBotIdSubagentsByIdSkillsError, PostBotsByBotIdSubagentsByIdSkillsResponse, PostBotsByBotIdSubagentsData, PostBotsByBotIdSubagentsError, PostBotsByBotIdSubagentsResponse, PostBotsByBotIdToolsData, PostBotsByBotIdToolsError, PostBotsByBotIdToolsResponse, PostBotsByIdChannelByPlatformSendChatData, PostBotsByIdChannelByPlatformSendChatError, PostBotsByIdChannelByPlatformSendChatResponse, PostBotsByIdChannelByPlatformSendData, PostBotsByIdChannelByPlatformSendError, PostBotsByIdChannelByPlatformSendResponse, PostBotsData, PostBotsError, PostBotsResponse, PostEmbeddingsData, PostEmbeddingsError, PostEmbeddingsResponse, PostModelsData, PostModelsError, PostModelsResponse, PostProvidersData, PostProvidersError, PostProvidersResponse, PostSearchProvidersData, PostSearchProvidersError, PostSearchProvidersResponse, PostUsersData, PostUsersError, PostUsersResponse, PutBotsByBotIdMcpByIdData, PutBotsByBotIdMcpByIdError, PutBotsByBotIdMcpByIdResponse, PutBotsByBotIdMcpImportData, PutBotsByBotIdMcpImportError, PutBotsByBotIdMcpImportResponse, PutBotsByBotIdScheduleByIdData, PutBotsByBotIdScheduleByIdError, PutBotsByBotIdScheduleByIdResponse, PutBotsByBotIdSettingsData, PutBotsByBotIdSettingsError, PutBotsByBotIdSettingsResponse, PutBotsByBotIdSubagentsByIdContextData, PutBotsByBotIdSubagentsByIdContextError, PutBotsByBotIdSubagentsByIdContextResponse, PutBotsByBotIdSubagentsByIdData, PutBotsByBotIdSubagentsByIdError, PutBotsByBotIdSubagentsByIdResponse, PutBotsByBotIdSubagentsByIdSkillsData, PutBotsByBotIdSubagentsByIdSkillsError, PutBotsByBotIdSubagentsByIdSkillsResponse, PutBotsByIdChannelByPlatformData, PutBotsByIdChannelByPlatformError, PutBotsByIdChannelByPlatformResponse, PutBotsByIdData, PutBotsByIdError, PutBotsByIdMembersData, PutBotsByIdMembersError, PutBotsByIdMembersResponse, PutBotsByIdOwnerData, PutBotsByIdOwnerError, PutBotsByIdOwnerResponse, PutBotsByIdResponse, PutModelsByIdData, PutModelsByIdError, PutModelsByIdResponse, PutModelsModelByModelIdData, PutModelsModelByModelIdError, PutModelsModelByModelIdResponse, PutProvidersByIdData, PutProvidersByIdError, PutProvidersByIdResponse, PutSearchProvidersByIdData, PutSearchProvidersByIdError, PutSearchProvidersByIdResponse, PutUsersByIdData, PutUsersByIdError, PutUsersByIdPasswordData, PutUsersByIdPasswordError, PutUsersByIdResponse, PutUsersMeChannelsByPlatformData, PutUsersMeChannelsByPlatformError, PutUsersMeChannelsByPlatformResponse, PutUsersMeData, PutUsersMeError, PutUsersMePasswordData, PutUsersMePasswordError, PutUsersMeResponse } from '../types.gen'; /** * Login @@ -1507,6 +1507,111 @@ export const getProvidersByIdModelsQuery = defineQueryOptions((options: Options< } })); +export const getSearchProvidersQueryKey = (options?: Options) => createQueryKey('getSearchProviders', options); + +/** + * List search providers + * + * List configured search providers + */ +export const getSearchProvidersQuery = defineQueryOptions((options?: Options) => ({ + key: getSearchProvidersQueryKey(options), + query: async (context) => { + const { data } = await getSearchProviders({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Create a search provider + * + * Create a search provider configuration + */ +export const postSearchProvidersMutation = (options?: Partial>): UseMutationOptions, PostSearchProvidersError> => ({ + mutation: async (vars) => { + const { data } = await postSearchProviders({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getSearchProvidersMetaQueryKey = (options?: Options) => createQueryKey('getSearchProvidersMeta', options); + +/** + * List search provider metadata + * + * List available search provider types and config schemas + */ +export const getSearchProvidersMetaQuery = defineQueryOptions((options?: Options) => ({ + key: getSearchProvidersMetaQueryKey(options), + query: async (context) => { + const { data } = await getSearchProvidersMeta({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Delete a search provider + * + * Delete search provider by ID + */ +export const deleteSearchProvidersByIdMutation = (options?: Partial>): UseMutationOptions, DeleteSearchProvidersByIdError> => ({ + mutation: async (vars) => { + const { data } = await deleteSearchProvidersById({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getSearchProvidersByIdQueryKey = (options: Options) => createQueryKey('getSearchProvidersById', options); + +/** + * Get a search provider + * + * Get search provider by ID + */ +export const getSearchProvidersByIdQuery = defineQueryOptions((options: Options) => ({ + key: getSearchProvidersByIdQueryKey(options), + query: async (context) => { + const { data } = await getSearchProvidersById({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Update a search provider + * + * Update search provider by ID + */ +export const putSearchProvidersByIdMutation = (options?: Partial>): UseMutationOptions, PutSearchProvidersByIdError> => ({ + mutation: async (vars) => { + const { data } = await putSearchProvidersById({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + export const getUsersQueryKey = (options?: Options) => createQueryKey('getUsers', options); /** diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index ada78749..8cd533fb 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export { deleteBotsByBotIdContainer, deleteBotsByBotIdContainerSkills, deleteBotsByBotIdMcpById, deleteBotsByBotIdMemory, deleteBotsByBotIdMemoryById, deleteBotsByBotIdScheduleById, deleteBotsByBotIdSettings, deleteBotsByBotIdSubagentsById, deleteBotsById, deleteBotsByIdMembersByUserId, deleteModelsById, deleteModelsModelByModelId, deleteProvidersById, getBots, getBotsByBotIdContainer, getBotsByBotIdContainerSkills, getBotsByBotIdContainerSnapshots, getBotsByBotIdMcp, getBotsByBotIdMcpById, getBotsByBotIdMcpExport, getBotsByBotIdMemory, getBotsByBotIdMemoryUsage, getBotsByBotIdMessages, getBotsByBotIdSchedule, getBotsByBotIdScheduleById, getBotsByBotIdSettings, getBotsByBotIdSubagents, getBotsByBotIdSubagentsById, getBotsByBotIdSubagentsByIdContext, getBotsByBotIdSubagentsByIdSkills, getBotsById, getBotsByIdChannelByPlatform, getBotsByIdChecks, getBotsByIdChecksKeys, getBotsByIdChecksRunByKey, getBotsByIdMembers, getChannels, getChannelsByPlatform, getModels, getModelsById, getModelsCount, getModelsModelByModelId, getProviders, getProvidersById, getProvidersByIdModels, getProvidersCount, getProvidersNameByName, getUsers, getUsersById, getUsersMe, getUsersMeChannelsByPlatform, getUsersMeIdentities, type Options, postAuthLogin, postBots, postBotsByBotIdContainer, postBotsByBotIdContainerSkills, postBotsByBotIdContainerSnapshots, postBotsByBotIdContainerStart, postBotsByBotIdContainerStop, postBotsByBotIdMcp, postBotsByBotIdMcpOpsBatchDelete, postBotsByBotIdMcpStdio, postBotsByBotIdMcpStdioByConnectionId, postBotsByBotIdMemory, postBotsByBotIdMemoryCompact, postBotsByBotIdMemoryRebuild, postBotsByBotIdMemorySearch, postBotsByBotIdSchedule, postBotsByBotIdSettings, postBotsByBotIdSubagents, postBotsByBotIdSubagentsByIdSkills, postBotsByBotIdTools, postBotsByIdChannelByPlatformSend, postBotsByIdChannelByPlatformSendChat, postEmbeddings, postModels, postProviders, postUsers, putBotsByBotIdMcpById, putBotsByBotIdMcpImport, putBotsByBotIdScheduleById, putBotsByBotIdSettings, putBotsByBotIdSubagentsById, putBotsByBotIdSubagentsByIdContext, putBotsByBotIdSubagentsByIdSkills, putBotsById, putBotsByIdChannelByPlatform, putBotsByIdMembers, putBotsByIdOwner, putModelsById, putModelsModelByModelId, putProvidersById, putUsersById, putUsersByIdPassword, putUsersMe, putUsersMeChannelsByPlatform, putUsersMePassword } from './sdk.gen'; -export type { AccountsAccount, AccountsCreateAccountRequest, AccountsListAccountsResponse, AccountsResetPasswordRequest, AccountsUpdateAccountRequest, AccountsUpdatePasswordRequest, AccountsUpdateProfileRequest, BotsBot, BotsBotCheck, BotsBotMember, BotsCreateBotRequest, BotsListBotsResponse, BotsListCheckKeysResponse, BotsListChecksResponse, BotsListMembersResponse, BotsTransferBotRequest, BotsUpdateBotRequest, BotsUpsertMemberRequest, ChannelAction, ChannelAttachment, ChannelAttachmentType, ChannelChannelCapabilities, ChannelChannelConfig, ChannelChannelIdentityBinding, ChannelConfigSchema, ChannelFieldSchema, ChannelFieldType, ChannelMessage, ChannelMessageFormat, ChannelMessagePart, ChannelMessagePartType, ChannelMessageTextStyle, ChannelReplyRef, ChannelSendRequest, ChannelTargetHint, ChannelTargetSpec, ChannelThreadRef, ChannelUpsertChannelIdentityConfigRequest, ChannelUpsertConfigRequest, ClientOptions, DeleteBotsByBotIdContainerData, DeleteBotsByBotIdContainerError, DeleteBotsByBotIdContainerErrors, DeleteBotsByBotIdContainerResponses, DeleteBotsByBotIdContainerSkillsData, DeleteBotsByBotIdContainerSkillsError, DeleteBotsByBotIdContainerSkillsErrors, DeleteBotsByBotIdContainerSkillsResponse, DeleteBotsByBotIdContainerSkillsResponses, DeleteBotsByBotIdMcpByIdData, DeleteBotsByBotIdMcpByIdError, DeleteBotsByBotIdMcpByIdErrors, DeleteBotsByBotIdMcpByIdResponses, DeleteBotsByBotIdMemoryByIdData, DeleteBotsByBotIdMemoryByIdError, DeleteBotsByBotIdMemoryByIdErrors, DeleteBotsByBotIdMemoryByIdResponse, DeleteBotsByBotIdMemoryByIdResponses, DeleteBotsByBotIdMemoryData, DeleteBotsByBotIdMemoryError, DeleteBotsByBotIdMemoryErrors, DeleteBotsByBotIdMemoryResponse, DeleteBotsByBotIdMemoryResponses, DeleteBotsByBotIdScheduleByIdData, DeleteBotsByBotIdScheduleByIdError, DeleteBotsByBotIdScheduleByIdErrors, DeleteBotsByBotIdScheduleByIdResponses, DeleteBotsByBotIdSettingsData, DeleteBotsByBotIdSettingsError, DeleteBotsByBotIdSettingsErrors, DeleteBotsByBotIdSettingsResponses, DeleteBotsByBotIdSubagentsByIdData, DeleteBotsByBotIdSubagentsByIdError, DeleteBotsByBotIdSubagentsByIdErrors, DeleteBotsByBotIdSubagentsByIdResponses, DeleteBotsByIdData, DeleteBotsByIdError, DeleteBotsByIdErrors, DeleteBotsByIdMembersByUserIdData, DeleteBotsByIdMembersByUserIdError, DeleteBotsByIdMembersByUserIdErrors, DeleteBotsByIdMembersByUserIdResponses, DeleteBotsByIdResponse, DeleteBotsByIdResponses, DeleteModelsByIdData, DeleteModelsByIdError, DeleteModelsByIdErrors, DeleteModelsByIdResponses, DeleteModelsModelByModelIdData, DeleteModelsModelByModelIdError, DeleteModelsModelByModelIdErrors, DeleteModelsModelByModelIdResponses, DeleteProvidersByIdData, DeleteProvidersByIdError, DeleteProvidersByIdErrors, DeleteProvidersByIdResponses, GetBotsByBotIdContainerData, GetBotsByBotIdContainerError, GetBotsByBotIdContainerErrors, GetBotsByBotIdContainerResponse, GetBotsByBotIdContainerResponses, GetBotsByBotIdContainerSkillsData, GetBotsByBotIdContainerSkillsError, GetBotsByBotIdContainerSkillsErrors, GetBotsByBotIdContainerSkillsResponse, GetBotsByBotIdContainerSkillsResponses, GetBotsByBotIdContainerSnapshotsData, GetBotsByBotIdContainerSnapshotsResponse, GetBotsByBotIdContainerSnapshotsResponses, GetBotsByBotIdMcpByIdData, GetBotsByBotIdMcpByIdError, GetBotsByBotIdMcpByIdErrors, GetBotsByBotIdMcpByIdResponse, GetBotsByBotIdMcpByIdResponses, GetBotsByBotIdMcpData, GetBotsByBotIdMcpError, GetBotsByBotIdMcpErrors, GetBotsByBotIdMcpExportData, GetBotsByBotIdMcpExportError, GetBotsByBotIdMcpExportErrors, GetBotsByBotIdMcpExportResponse, GetBotsByBotIdMcpExportResponses, GetBotsByBotIdMcpResponse, GetBotsByBotIdMcpResponses, GetBotsByBotIdMemoryData, GetBotsByBotIdMemoryError, GetBotsByBotIdMemoryErrors, GetBotsByBotIdMemoryResponse, GetBotsByBotIdMemoryResponses, GetBotsByBotIdMemoryUsageData, GetBotsByBotIdMemoryUsageError, GetBotsByBotIdMemoryUsageErrors, GetBotsByBotIdMemoryUsageResponse, GetBotsByBotIdMemoryUsageResponses, GetBotsByBotIdMessagesData, GetBotsByBotIdMessagesError, GetBotsByBotIdMessagesErrors, GetBotsByBotIdMessagesResponse, GetBotsByBotIdMessagesResponses, GetBotsByBotIdScheduleByIdData, GetBotsByBotIdScheduleByIdError, GetBotsByBotIdScheduleByIdErrors, GetBotsByBotIdScheduleByIdResponse, GetBotsByBotIdScheduleByIdResponses, GetBotsByBotIdScheduleData, GetBotsByBotIdScheduleError, GetBotsByBotIdScheduleErrors, GetBotsByBotIdScheduleResponse, GetBotsByBotIdScheduleResponses, GetBotsByBotIdSettingsData, GetBotsByBotIdSettingsError, GetBotsByBotIdSettingsErrors, GetBotsByBotIdSettingsResponse, GetBotsByBotIdSettingsResponses, GetBotsByBotIdSubagentsByIdContextData, GetBotsByBotIdSubagentsByIdContextError, GetBotsByBotIdSubagentsByIdContextErrors, GetBotsByBotIdSubagentsByIdContextResponse, GetBotsByBotIdSubagentsByIdContextResponses, GetBotsByBotIdSubagentsByIdData, GetBotsByBotIdSubagentsByIdError, GetBotsByBotIdSubagentsByIdErrors, GetBotsByBotIdSubagentsByIdResponse, GetBotsByBotIdSubagentsByIdResponses, GetBotsByBotIdSubagentsByIdSkillsData, GetBotsByBotIdSubagentsByIdSkillsError, GetBotsByBotIdSubagentsByIdSkillsErrors, GetBotsByBotIdSubagentsByIdSkillsResponse, GetBotsByBotIdSubagentsByIdSkillsResponses, GetBotsByBotIdSubagentsData, GetBotsByBotIdSubagentsError, GetBotsByBotIdSubagentsErrors, GetBotsByBotIdSubagentsResponse, GetBotsByBotIdSubagentsResponses, GetBotsByIdChannelByPlatformData, GetBotsByIdChannelByPlatformError, GetBotsByIdChannelByPlatformErrors, GetBotsByIdChannelByPlatformResponse, GetBotsByIdChannelByPlatformResponses, GetBotsByIdChecksData, GetBotsByIdChecksError, GetBotsByIdChecksErrors, GetBotsByIdChecksKeysData, GetBotsByIdChecksKeysResponse, GetBotsByIdChecksKeysResponses, GetBotsByIdChecksResponse, GetBotsByIdChecksResponses, GetBotsByIdChecksRunByKeyData, GetBotsByIdChecksRunByKeyResponse, GetBotsByIdChecksRunByKeyResponses, GetBotsByIdData, GetBotsByIdError, GetBotsByIdErrors, GetBotsByIdMembersData, GetBotsByIdMembersError, GetBotsByIdMembersErrors, GetBotsByIdMembersResponse, GetBotsByIdMembersResponses, GetBotsByIdResponse, GetBotsByIdResponses, GetBotsData, GetBotsError, GetBotsErrors, GetBotsResponse, GetBotsResponses, GetChannelsByPlatformData, GetChannelsByPlatformError, GetChannelsByPlatformErrors, GetChannelsByPlatformResponse, GetChannelsByPlatformResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetModelsByIdData, GetModelsByIdError, GetModelsByIdErrors, GetModelsByIdResponse, GetModelsByIdResponses, GetModelsCountData, GetModelsCountError, GetModelsCountErrors, GetModelsCountResponse, GetModelsCountResponses, GetModelsData, GetModelsError, GetModelsErrors, GetModelsModelByModelIdData, GetModelsModelByModelIdError, GetModelsModelByModelIdErrors, GetModelsModelByModelIdResponse, GetModelsModelByModelIdResponses, GetModelsResponse, GetModelsResponses, GetProvidersByIdData, GetProvidersByIdError, GetProvidersByIdErrors, GetProvidersByIdModelsData, GetProvidersByIdModelsError, GetProvidersByIdModelsErrors, GetProvidersByIdModelsResponse, GetProvidersByIdModelsResponses, GetProvidersByIdResponse, GetProvidersByIdResponses, GetProvidersCountData, GetProvidersCountError, GetProvidersCountErrors, GetProvidersCountResponse, GetProvidersCountResponses, GetProvidersData, GetProvidersError, GetProvidersErrors, GetProvidersNameByNameData, GetProvidersNameByNameError, GetProvidersNameByNameErrors, GetProvidersNameByNameResponse, GetProvidersNameByNameResponses, GetProvidersResponse, GetProvidersResponses, GetUsersByIdData, GetUsersByIdError, GetUsersByIdErrors, GetUsersByIdResponse, GetUsersByIdResponses, GetUsersData, GetUsersError, GetUsersErrors, GetUsersMeChannelsByPlatformData, GetUsersMeChannelsByPlatformError, GetUsersMeChannelsByPlatformErrors, GetUsersMeChannelsByPlatformResponse, GetUsersMeChannelsByPlatformResponses, GetUsersMeData, GetUsersMeError, GetUsersMeErrors, GetUsersMeIdentitiesData, GetUsersMeIdentitiesError, GetUsersMeIdentitiesErrors, GetUsersMeIdentitiesResponse, GetUsersMeIdentitiesResponses, GetUsersMeResponse, GetUsersMeResponses, GetUsersResponse, GetUsersResponses, GithubComMemohaiMemohInternalMcpConnection, HandlersBatchDeleteRequest, HandlersChannelMeta, HandlersCreateContainerRequest, HandlersCreateContainerResponse, HandlersCreateSnapshotRequest, HandlersCreateSnapshotResponse, HandlersEmbeddingsInput, HandlersEmbeddingsRequest, HandlersEmbeddingsResponse, HandlersEmbeddingsUsage, HandlersErrorResponse, HandlersGetContainerResponse, HandlersListMyIdentitiesResponse, HandlersListSnapshotsResponse, HandlersLoginRequest, HandlersLoginResponse, HandlersMcpStdioRequest, HandlersMcpStdioResponse, HandlersMemoryAddPayload, HandlersMemoryCompactPayload, HandlersMemoryDeletePayload, HandlersMemorySearchPayload, HandlersSkillItem, HandlersSkillsDeleteRequest, HandlersSkillsOpResponse, HandlersSkillsResponse, HandlersSkillsUpsertRequest, HandlersSnapshotInfo, IdentitiesChannelIdentity, McpExportResponse, McpImportRequest, McpListResponse, McpMcpServerEntry, McpUpsertRequest, MemoryCdfPoint, MemoryCompactResult, MemoryDeleteResponse, MemoryMemoryItem, MemoryMessage, MemoryRebuildResult, MemorySearchResponse, MemoryTopKBucket, MemoryUsageResponse, MessageMessage, ModelsAddRequest, ModelsAddResponse, ModelsCountResponse, ModelsGetResponse, ModelsModelType, ModelsUpdateRequest, PostAuthLoginData, PostAuthLoginError, PostAuthLoginErrors, PostAuthLoginResponse, PostAuthLoginResponses, PostBotsByBotIdContainerData, PostBotsByBotIdContainerError, PostBotsByBotIdContainerErrors, PostBotsByBotIdContainerResponse, PostBotsByBotIdContainerResponses, PostBotsByBotIdContainerSkillsData, PostBotsByBotIdContainerSkillsError, PostBotsByBotIdContainerSkillsErrors, PostBotsByBotIdContainerSkillsResponse, PostBotsByBotIdContainerSkillsResponses, PostBotsByBotIdContainerSnapshotsData, PostBotsByBotIdContainerSnapshotsError, PostBotsByBotIdContainerSnapshotsErrors, PostBotsByBotIdContainerSnapshotsResponse, PostBotsByBotIdContainerSnapshotsResponses, PostBotsByBotIdContainerStartData, PostBotsByBotIdContainerStartError, PostBotsByBotIdContainerStartErrors, PostBotsByBotIdContainerStartResponse, PostBotsByBotIdContainerStartResponses, PostBotsByBotIdContainerStopData, PostBotsByBotIdContainerStopError, PostBotsByBotIdContainerStopErrors, PostBotsByBotIdContainerStopResponse, PostBotsByBotIdContainerStopResponses, PostBotsByBotIdMcpData, PostBotsByBotIdMcpError, PostBotsByBotIdMcpErrors, PostBotsByBotIdMcpOpsBatchDeleteData, PostBotsByBotIdMcpOpsBatchDeleteError, PostBotsByBotIdMcpOpsBatchDeleteErrors, PostBotsByBotIdMcpOpsBatchDeleteResponses, PostBotsByBotIdMcpResponse, PostBotsByBotIdMcpResponses, PostBotsByBotIdMcpStdioByConnectionIdData, PostBotsByBotIdMcpStdioByConnectionIdError, PostBotsByBotIdMcpStdioByConnectionIdErrors, PostBotsByBotIdMcpStdioByConnectionIdResponse, PostBotsByBotIdMcpStdioByConnectionIdResponses, PostBotsByBotIdMcpStdioData, PostBotsByBotIdMcpStdioError, PostBotsByBotIdMcpStdioErrors, PostBotsByBotIdMcpStdioResponse, PostBotsByBotIdMcpStdioResponses, PostBotsByBotIdMemoryCompactData, PostBotsByBotIdMemoryCompactError, PostBotsByBotIdMemoryCompactErrors, PostBotsByBotIdMemoryCompactResponse, PostBotsByBotIdMemoryCompactResponses, PostBotsByBotIdMemoryData, PostBotsByBotIdMemoryError, PostBotsByBotIdMemoryErrors, PostBotsByBotIdMemoryRebuildData, PostBotsByBotIdMemoryRebuildError, PostBotsByBotIdMemoryRebuildErrors, PostBotsByBotIdMemoryRebuildResponse, PostBotsByBotIdMemoryRebuildResponses, PostBotsByBotIdMemoryResponse, PostBotsByBotIdMemoryResponses, PostBotsByBotIdMemorySearchData, PostBotsByBotIdMemorySearchError, PostBotsByBotIdMemorySearchErrors, PostBotsByBotIdMemorySearchResponse, PostBotsByBotIdMemorySearchResponses, PostBotsByBotIdScheduleData, PostBotsByBotIdScheduleError, PostBotsByBotIdScheduleErrors, PostBotsByBotIdScheduleResponse, PostBotsByBotIdScheduleResponses, PostBotsByBotIdSettingsData, PostBotsByBotIdSettingsError, PostBotsByBotIdSettingsErrors, PostBotsByBotIdSettingsResponse, PostBotsByBotIdSettingsResponses, PostBotsByBotIdSubagentsByIdSkillsData, PostBotsByBotIdSubagentsByIdSkillsError, PostBotsByBotIdSubagentsByIdSkillsErrors, PostBotsByBotIdSubagentsByIdSkillsResponse, PostBotsByBotIdSubagentsByIdSkillsResponses, PostBotsByBotIdSubagentsData, PostBotsByBotIdSubagentsError, PostBotsByBotIdSubagentsErrors, PostBotsByBotIdSubagentsResponse, PostBotsByBotIdSubagentsResponses, PostBotsByBotIdToolsData, PostBotsByBotIdToolsError, PostBotsByBotIdToolsErrors, PostBotsByBotIdToolsResponse, PostBotsByBotIdToolsResponses, PostBotsByIdChannelByPlatformSendChatData, PostBotsByIdChannelByPlatformSendChatError, PostBotsByIdChannelByPlatformSendChatErrors, PostBotsByIdChannelByPlatformSendChatResponse, PostBotsByIdChannelByPlatformSendChatResponses, PostBotsByIdChannelByPlatformSendData, PostBotsByIdChannelByPlatformSendError, PostBotsByIdChannelByPlatformSendErrors, PostBotsByIdChannelByPlatformSendResponse, PostBotsByIdChannelByPlatformSendResponses, PostBotsData, PostBotsError, PostBotsErrors, PostBotsResponse, PostBotsResponses, PostEmbeddingsData, PostEmbeddingsError, PostEmbeddingsErrors, PostEmbeddingsResponse, PostEmbeddingsResponses, PostModelsData, PostModelsError, PostModelsErrors, PostModelsResponse, PostModelsResponses, PostProvidersData, PostProvidersError, PostProvidersErrors, PostProvidersResponse, PostProvidersResponses, PostUsersData, PostUsersError, PostUsersErrors, PostUsersResponse, PostUsersResponses, ProvidersClientType, ProvidersCountResponse, ProvidersCreateRequest, ProvidersGetResponse, ProvidersUpdateRequest, PutBotsByBotIdMcpByIdData, PutBotsByBotIdMcpByIdError, PutBotsByBotIdMcpByIdErrors, PutBotsByBotIdMcpByIdResponse, PutBotsByBotIdMcpByIdResponses, PutBotsByBotIdMcpImportData, PutBotsByBotIdMcpImportError, PutBotsByBotIdMcpImportErrors, PutBotsByBotIdMcpImportResponse, PutBotsByBotIdMcpImportResponses, PutBotsByBotIdScheduleByIdData, PutBotsByBotIdScheduleByIdError, PutBotsByBotIdScheduleByIdErrors, PutBotsByBotIdScheduleByIdResponse, PutBotsByBotIdScheduleByIdResponses, PutBotsByBotIdSettingsData, PutBotsByBotIdSettingsError, PutBotsByBotIdSettingsErrors, PutBotsByBotIdSettingsResponse, PutBotsByBotIdSettingsResponses, PutBotsByBotIdSubagentsByIdContextData, PutBotsByBotIdSubagentsByIdContextError, PutBotsByBotIdSubagentsByIdContextErrors, PutBotsByBotIdSubagentsByIdContextResponse, PutBotsByBotIdSubagentsByIdContextResponses, PutBotsByBotIdSubagentsByIdData, PutBotsByBotIdSubagentsByIdError, PutBotsByBotIdSubagentsByIdErrors, PutBotsByBotIdSubagentsByIdResponse, PutBotsByBotIdSubagentsByIdResponses, PutBotsByBotIdSubagentsByIdSkillsData, PutBotsByBotIdSubagentsByIdSkillsError, PutBotsByBotIdSubagentsByIdSkillsErrors, PutBotsByBotIdSubagentsByIdSkillsResponse, PutBotsByBotIdSubagentsByIdSkillsResponses, PutBotsByIdChannelByPlatformData, PutBotsByIdChannelByPlatformError, PutBotsByIdChannelByPlatformErrors, PutBotsByIdChannelByPlatformResponse, PutBotsByIdChannelByPlatformResponses, PutBotsByIdData, PutBotsByIdError, PutBotsByIdErrors, PutBotsByIdMembersData, PutBotsByIdMembersError, PutBotsByIdMembersErrors, PutBotsByIdMembersResponse, PutBotsByIdMembersResponses, PutBotsByIdOwnerData, PutBotsByIdOwnerError, PutBotsByIdOwnerErrors, PutBotsByIdOwnerResponse, PutBotsByIdOwnerResponses, PutBotsByIdResponse, PutBotsByIdResponses, PutModelsByIdData, PutModelsByIdError, PutModelsByIdErrors, PutModelsByIdResponse, PutModelsByIdResponses, PutModelsModelByModelIdData, PutModelsModelByModelIdError, PutModelsModelByModelIdErrors, PutModelsModelByModelIdResponse, PutModelsModelByModelIdResponses, PutProvidersByIdData, PutProvidersByIdError, PutProvidersByIdErrors, PutProvidersByIdResponse, PutProvidersByIdResponses, PutUsersByIdData, PutUsersByIdError, PutUsersByIdErrors, PutUsersByIdPasswordData, PutUsersByIdPasswordError, PutUsersByIdPasswordErrors, PutUsersByIdPasswordResponses, PutUsersByIdResponse, PutUsersByIdResponses, PutUsersMeChannelsByPlatformData, PutUsersMeChannelsByPlatformError, PutUsersMeChannelsByPlatformErrors, PutUsersMeChannelsByPlatformResponse, PutUsersMeChannelsByPlatformResponses, PutUsersMeData, PutUsersMeError, PutUsersMeErrors, PutUsersMePasswordData, PutUsersMePasswordError, PutUsersMePasswordErrors, PutUsersMePasswordResponses, PutUsersMeResponse, PutUsersMeResponses, ScheduleCreateRequest, ScheduleListResponse, ScheduleNullableInt, ScheduleSchedule, ScheduleUpdateRequest, SettingsSettings, SettingsUpsertRequest, SubagentAddSkillsRequest, SubagentContextResponse, SubagentCreateRequest, SubagentListResponse, SubagentSkillsResponse, SubagentSubagent, SubagentUpdateContextRequest, SubagentUpdateRequest, SubagentUpdateSkillsRequest } from './types.gen'; +export { deleteBotsByBotIdContainer, deleteBotsByBotIdContainerSkills, deleteBotsByBotIdMcpById, deleteBotsByBotIdMemory, deleteBotsByBotIdMemoryById, deleteBotsByBotIdScheduleById, deleteBotsByBotIdSettings, deleteBotsByBotIdSubagentsById, deleteBotsById, deleteBotsByIdMembersByUserId, deleteModelsById, deleteModelsModelByModelId, deleteProvidersById, deleteSearchProvidersById, getBots, getBotsByBotIdContainer, getBotsByBotIdContainerSkills, getBotsByBotIdContainerSnapshots, getBotsByBotIdMcp, getBotsByBotIdMcpById, getBotsByBotIdMcpExport, getBotsByBotIdMemory, getBotsByBotIdMemoryUsage, getBotsByBotIdMessages, getBotsByBotIdSchedule, getBotsByBotIdScheduleById, getBotsByBotIdSettings, getBotsByBotIdSubagents, getBotsByBotIdSubagentsById, getBotsByBotIdSubagentsByIdContext, getBotsByBotIdSubagentsByIdSkills, getBotsById, getBotsByIdChannelByPlatform, getBotsByIdChecks, getBotsByIdChecksKeys, getBotsByIdChecksRunByKey, getBotsByIdMembers, getChannels, getChannelsByPlatform, getModels, getModelsById, getModelsCount, getModelsModelByModelId, getProviders, getProvidersById, getProvidersByIdModels, getProvidersCount, getProvidersNameByName, getSearchProviders, getSearchProvidersById, getSearchProvidersMeta, getUsers, getUsersById, getUsersMe, getUsersMeChannelsByPlatform, getUsersMeIdentities, type Options, postAuthLogin, postBots, postBotsByBotIdContainer, postBotsByBotIdContainerSkills, postBotsByBotIdContainerSnapshots, postBotsByBotIdContainerStart, postBotsByBotIdContainerStop, postBotsByBotIdMcp, postBotsByBotIdMcpOpsBatchDelete, postBotsByBotIdMcpStdio, postBotsByBotIdMcpStdioByConnectionId, postBotsByBotIdMemory, postBotsByBotIdMemoryCompact, postBotsByBotIdMemoryRebuild, postBotsByBotIdMemorySearch, postBotsByBotIdSchedule, postBotsByBotIdSettings, postBotsByBotIdSubagents, postBotsByBotIdSubagentsByIdSkills, postBotsByBotIdTools, postBotsByIdChannelByPlatformSend, postBotsByIdChannelByPlatformSendChat, postEmbeddings, postModels, postProviders, postSearchProviders, postUsers, putBotsByBotIdMcpById, putBotsByBotIdMcpImport, putBotsByBotIdScheduleById, putBotsByBotIdSettings, putBotsByBotIdSubagentsById, putBotsByBotIdSubagentsByIdContext, putBotsByBotIdSubagentsByIdSkills, putBotsById, putBotsByIdChannelByPlatform, putBotsByIdMembers, putBotsByIdOwner, putModelsById, putModelsModelByModelId, putProvidersById, putSearchProvidersById, putUsersById, putUsersByIdPassword, putUsersMe, putUsersMeChannelsByPlatform, putUsersMePassword } from './sdk.gen'; +export type { AccountsAccount, AccountsCreateAccountRequest, AccountsListAccountsResponse, AccountsResetPasswordRequest, AccountsUpdateAccountRequest, AccountsUpdatePasswordRequest, AccountsUpdateProfileRequest, BotsBot, BotsBotCheck, BotsBotMember, BotsCreateBotRequest, BotsListBotsResponse, BotsListCheckKeysResponse, BotsListChecksResponse, BotsListMembersResponse, BotsTransferBotRequest, BotsUpdateBotRequest, BotsUpsertMemberRequest, ChannelAction, ChannelAttachment, ChannelAttachmentType, ChannelChannelCapabilities, ChannelChannelConfig, ChannelChannelIdentityBinding, ChannelConfigSchema, ChannelFieldSchema, ChannelFieldType, ChannelMessage, ChannelMessageFormat, ChannelMessagePart, ChannelMessagePartType, ChannelMessageTextStyle, ChannelReplyRef, ChannelSendRequest, ChannelTargetHint, ChannelTargetSpec, ChannelThreadRef, ChannelUpsertChannelIdentityConfigRequest, ChannelUpsertConfigRequest, ClientOptions, DeleteBotsByBotIdContainerData, DeleteBotsByBotIdContainerError, DeleteBotsByBotIdContainerErrors, DeleteBotsByBotIdContainerResponses, DeleteBotsByBotIdContainerSkillsData, DeleteBotsByBotIdContainerSkillsError, DeleteBotsByBotIdContainerSkillsErrors, DeleteBotsByBotIdContainerSkillsResponse, DeleteBotsByBotIdContainerSkillsResponses, DeleteBotsByBotIdMcpByIdData, DeleteBotsByBotIdMcpByIdError, DeleteBotsByBotIdMcpByIdErrors, DeleteBotsByBotIdMcpByIdResponses, DeleteBotsByBotIdMemoryByIdData, DeleteBotsByBotIdMemoryByIdError, DeleteBotsByBotIdMemoryByIdErrors, DeleteBotsByBotIdMemoryByIdResponse, DeleteBotsByBotIdMemoryByIdResponses, DeleteBotsByBotIdMemoryData, DeleteBotsByBotIdMemoryError, DeleteBotsByBotIdMemoryErrors, DeleteBotsByBotIdMemoryResponse, DeleteBotsByBotIdMemoryResponses, DeleteBotsByBotIdScheduleByIdData, DeleteBotsByBotIdScheduleByIdError, DeleteBotsByBotIdScheduleByIdErrors, DeleteBotsByBotIdScheduleByIdResponses, DeleteBotsByBotIdSettingsData, DeleteBotsByBotIdSettingsError, DeleteBotsByBotIdSettingsErrors, DeleteBotsByBotIdSettingsResponses, DeleteBotsByBotIdSubagentsByIdData, DeleteBotsByBotIdSubagentsByIdError, DeleteBotsByBotIdSubagentsByIdErrors, DeleteBotsByBotIdSubagentsByIdResponses, DeleteBotsByIdData, DeleteBotsByIdError, DeleteBotsByIdErrors, DeleteBotsByIdMembersByUserIdData, DeleteBotsByIdMembersByUserIdError, DeleteBotsByIdMembersByUserIdErrors, DeleteBotsByIdMembersByUserIdResponses, DeleteBotsByIdResponse, DeleteBotsByIdResponses, DeleteModelsByIdData, DeleteModelsByIdError, DeleteModelsByIdErrors, DeleteModelsByIdResponses, DeleteModelsModelByModelIdData, DeleteModelsModelByModelIdError, DeleteModelsModelByModelIdErrors, DeleteModelsModelByModelIdResponses, DeleteProvidersByIdData, DeleteProvidersByIdError, DeleteProvidersByIdErrors, DeleteProvidersByIdResponses, DeleteSearchProvidersByIdData, DeleteSearchProvidersByIdError, DeleteSearchProvidersByIdErrors, DeleteSearchProvidersByIdResponses, GetBotsByBotIdContainerData, GetBotsByBotIdContainerError, GetBotsByBotIdContainerErrors, GetBotsByBotIdContainerResponse, GetBotsByBotIdContainerResponses, GetBotsByBotIdContainerSkillsData, GetBotsByBotIdContainerSkillsError, GetBotsByBotIdContainerSkillsErrors, GetBotsByBotIdContainerSkillsResponse, GetBotsByBotIdContainerSkillsResponses, GetBotsByBotIdContainerSnapshotsData, GetBotsByBotIdContainerSnapshotsResponse, GetBotsByBotIdContainerSnapshotsResponses, GetBotsByBotIdMcpByIdData, GetBotsByBotIdMcpByIdError, GetBotsByBotIdMcpByIdErrors, GetBotsByBotIdMcpByIdResponse, GetBotsByBotIdMcpByIdResponses, GetBotsByBotIdMcpData, GetBotsByBotIdMcpError, GetBotsByBotIdMcpErrors, GetBotsByBotIdMcpExportData, GetBotsByBotIdMcpExportError, GetBotsByBotIdMcpExportErrors, GetBotsByBotIdMcpExportResponse, GetBotsByBotIdMcpExportResponses, GetBotsByBotIdMcpResponse, GetBotsByBotIdMcpResponses, GetBotsByBotIdMemoryData, GetBotsByBotIdMemoryError, GetBotsByBotIdMemoryErrors, GetBotsByBotIdMemoryResponse, GetBotsByBotIdMemoryResponses, GetBotsByBotIdMemoryUsageData, GetBotsByBotIdMemoryUsageError, GetBotsByBotIdMemoryUsageErrors, GetBotsByBotIdMemoryUsageResponse, GetBotsByBotIdMemoryUsageResponses, GetBotsByBotIdMessagesData, GetBotsByBotIdMessagesError, GetBotsByBotIdMessagesErrors, GetBotsByBotIdMessagesResponse, GetBotsByBotIdMessagesResponses, GetBotsByBotIdScheduleByIdData, GetBotsByBotIdScheduleByIdError, GetBotsByBotIdScheduleByIdErrors, GetBotsByBotIdScheduleByIdResponse, GetBotsByBotIdScheduleByIdResponses, GetBotsByBotIdScheduleData, GetBotsByBotIdScheduleError, GetBotsByBotIdScheduleErrors, GetBotsByBotIdScheduleResponse, GetBotsByBotIdScheduleResponses, GetBotsByBotIdSettingsData, GetBotsByBotIdSettingsError, GetBotsByBotIdSettingsErrors, GetBotsByBotIdSettingsResponse, GetBotsByBotIdSettingsResponses, GetBotsByBotIdSubagentsByIdContextData, GetBotsByBotIdSubagentsByIdContextError, GetBotsByBotIdSubagentsByIdContextErrors, GetBotsByBotIdSubagentsByIdContextResponse, GetBotsByBotIdSubagentsByIdContextResponses, GetBotsByBotIdSubagentsByIdData, GetBotsByBotIdSubagentsByIdError, GetBotsByBotIdSubagentsByIdErrors, GetBotsByBotIdSubagentsByIdResponse, GetBotsByBotIdSubagentsByIdResponses, GetBotsByBotIdSubagentsByIdSkillsData, GetBotsByBotIdSubagentsByIdSkillsError, GetBotsByBotIdSubagentsByIdSkillsErrors, GetBotsByBotIdSubagentsByIdSkillsResponse, GetBotsByBotIdSubagentsByIdSkillsResponses, GetBotsByBotIdSubagentsData, GetBotsByBotIdSubagentsError, GetBotsByBotIdSubagentsErrors, GetBotsByBotIdSubagentsResponse, GetBotsByBotIdSubagentsResponses, GetBotsByIdChannelByPlatformData, GetBotsByIdChannelByPlatformError, GetBotsByIdChannelByPlatformErrors, GetBotsByIdChannelByPlatformResponse, GetBotsByIdChannelByPlatformResponses, GetBotsByIdChecksData, GetBotsByIdChecksError, GetBotsByIdChecksErrors, GetBotsByIdChecksKeysData, GetBotsByIdChecksKeysResponse, GetBotsByIdChecksKeysResponses, GetBotsByIdChecksResponse, GetBotsByIdChecksResponses, GetBotsByIdChecksRunByKeyData, GetBotsByIdChecksRunByKeyResponse, GetBotsByIdChecksRunByKeyResponses, GetBotsByIdData, GetBotsByIdError, GetBotsByIdErrors, GetBotsByIdMembersData, GetBotsByIdMembersError, GetBotsByIdMembersErrors, GetBotsByIdMembersResponse, GetBotsByIdMembersResponses, GetBotsByIdResponse, GetBotsByIdResponses, GetBotsData, GetBotsError, GetBotsErrors, GetBotsResponse, GetBotsResponses, GetChannelsByPlatformData, GetChannelsByPlatformError, GetChannelsByPlatformErrors, GetChannelsByPlatformResponse, GetChannelsByPlatformResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetModelsByIdData, GetModelsByIdError, GetModelsByIdErrors, GetModelsByIdResponse, GetModelsByIdResponses, GetModelsCountData, GetModelsCountError, GetModelsCountErrors, GetModelsCountResponse, GetModelsCountResponses, GetModelsData, GetModelsError, GetModelsErrors, GetModelsModelByModelIdData, GetModelsModelByModelIdError, GetModelsModelByModelIdErrors, GetModelsModelByModelIdResponse, GetModelsModelByModelIdResponses, GetModelsResponse, GetModelsResponses, GetProvidersByIdData, GetProvidersByIdError, GetProvidersByIdErrors, GetProvidersByIdModelsData, GetProvidersByIdModelsError, GetProvidersByIdModelsErrors, GetProvidersByIdModelsResponse, GetProvidersByIdModelsResponses, GetProvidersByIdResponse, GetProvidersByIdResponses, GetProvidersCountData, GetProvidersCountError, GetProvidersCountErrors, GetProvidersCountResponse, GetProvidersCountResponses, GetProvidersData, GetProvidersError, GetProvidersErrors, GetProvidersNameByNameData, GetProvidersNameByNameError, GetProvidersNameByNameErrors, GetProvidersNameByNameResponse, GetProvidersNameByNameResponses, GetProvidersResponse, GetProvidersResponses, GetSearchProvidersByIdData, GetSearchProvidersByIdError, GetSearchProvidersByIdErrors, GetSearchProvidersByIdResponse, GetSearchProvidersByIdResponses, GetSearchProvidersData, GetSearchProvidersError, GetSearchProvidersErrors, GetSearchProvidersMetaData, GetSearchProvidersMetaResponse, GetSearchProvidersMetaResponses, GetSearchProvidersResponse, GetSearchProvidersResponses, GetUsersByIdData, GetUsersByIdError, GetUsersByIdErrors, GetUsersByIdResponse, GetUsersByIdResponses, GetUsersData, GetUsersError, GetUsersErrors, GetUsersMeChannelsByPlatformData, GetUsersMeChannelsByPlatformError, GetUsersMeChannelsByPlatformErrors, GetUsersMeChannelsByPlatformResponse, GetUsersMeChannelsByPlatformResponses, GetUsersMeData, GetUsersMeError, GetUsersMeErrors, GetUsersMeIdentitiesData, GetUsersMeIdentitiesError, GetUsersMeIdentitiesErrors, GetUsersMeIdentitiesResponse, GetUsersMeIdentitiesResponses, GetUsersMeResponse, GetUsersMeResponses, GetUsersResponse, GetUsersResponses, GithubComMemohaiMemohInternalMcpConnection, HandlersBatchDeleteRequest, HandlersChannelMeta, HandlersCreateContainerRequest, HandlersCreateContainerResponse, HandlersCreateSnapshotRequest, HandlersCreateSnapshotResponse, HandlersEmbeddingsInput, HandlersEmbeddingsRequest, HandlersEmbeddingsResponse, HandlersEmbeddingsUsage, HandlersErrorResponse, HandlersGetContainerResponse, HandlersListMyIdentitiesResponse, HandlersListSnapshotsResponse, HandlersLoginRequest, HandlersLoginResponse, HandlersMcpStdioRequest, HandlersMcpStdioResponse, HandlersMemoryAddPayload, HandlersMemoryCompactPayload, HandlersMemoryDeletePayload, HandlersMemorySearchPayload, HandlersSkillItem, HandlersSkillsDeleteRequest, HandlersSkillsOpResponse, HandlersSkillsResponse, HandlersSkillsUpsertRequest, HandlersSnapshotInfo, IdentitiesChannelIdentity, McpExportResponse, McpImportRequest, McpListResponse, McpMcpServerEntry, McpUpsertRequest, MemoryCdfPoint, MemoryCompactResult, MemoryDeleteResponse, MemoryMemoryItem, MemoryMessage, MemoryRebuildResult, MemorySearchResponse, MemoryTopKBucket, MemoryUsageResponse, MessageMessage, ModelsAddRequest, ModelsAddResponse, ModelsCountResponse, ModelsGetResponse, ModelsModelType, ModelsUpdateRequest, PostAuthLoginData, PostAuthLoginError, PostAuthLoginErrors, PostAuthLoginResponse, PostAuthLoginResponses, PostBotsByBotIdContainerData, PostBotsByBotIdContainerError, PostBotsByBotIdContainerErrors, PostBotsByBotIdContainerResponse, PostBotsByBotIdContainerResponses, PostBotsByBotIdContainerSkillsData, PostBotsByBotIdContainerSkillsError, PostBotsByBotIdContainerSkillsErrors, PostBotsByBotIdContainerSkillsResponse, PostBotsByBotIdContainerSkillsResponses, PostBotsByBotIdContainerSnapshotsData, PostBotsByBotIdContainerSnapshotsError, PostBotsByBotIdContainerSnapshotsErrors, PostBotsByBotIdContainerSnapshotsResponse, PostBotsByBotIdContainerSnapshotsResponses, PostBotsByBotIdContainerStartData, PostBotsByBotIdContainerStartError, PostBotsByBotIdContainerStartErrors, PostBotsByBotIdContainerStartResponse, PostBotsByBotIdContainerStartResponses, PostBotsByBotIdContainerStopData, PostBotsByBotIdContainerStopError, PostBotsByBotIdContainerStopErrors, PostBotsByBotIdContainerStopResponse, PostBotsByBotIdContainerStopResponses, PostBotsByBotIdMcpData, PostBotsByBotIdMcpError, PostBotsByBotIdMcpErrors, PostBotsByBotIdMcpOpsBatchDeleteData, PostBotsByBotIdMcpOpsBatchDeleteError, PostBotsByBotIdMcpOpsBatchDeleteErrors, PostBotsByBotIdMcpOpsBatchDeleteResponses, PostBotsByBotIdMcpResponse, PostBotsByBotIdMcpResponses, PostBotsByBotIdMcpStdioByConnectionIdData, PostBotsByBotIdMcpStdioByConnectionIdError, PostBotsByBotIdMcpStdioByConnectionIdErrors, PostBotsByBotIdMcpStdioByConnectionIdResponse, PostBotsByBotIdMcpStdioByConnectionIdResponses, PostBotsByBotIdMcpStdioData, PostBotsByBotIdMcpStdioError, PostBotsByBotIdMcpStdioErrors, PostBotsByBotIdMcpStdioResponse, PostBotsByBotIdMcpStdioResponses, PostBotsByBotIdMemoryCompactData, PostBotsByBotIdMemoryCompactError, PostBotsByBotIdMemoryCompactErrors, PostBotsByBotIdMemoryCompactResponse, PostBotsByBotIdMemoryCompactResponses, PostBotsByBotIdMemoryData, PostBotsByBotIdMemoryError, PostBotsByBotIdMemoryErrors, PostBotsByBotIdMemoryRebuildData, PostBotsByBotIdMemoryRebuildError, PostBotsByBotIdMemoryRebuildErrors, PostBotsByBotIdMemoryRebuildResponse, PostBotsByBotIdMemoryRebuildResponses, PostBotsByBotIdMemoryResponse, PostBotsByBotIdMemoryResponses, PostBotsByBotIdMemorySearchData, PostBotsByBotIdMemorySearchError, PostBotsByBotIdMemorySearchErrors, PostBotsByBotIdMemorySearchResponse, PostBotsByBotIdMemorySearchResponses, PostBotsByBotIdScheduleData, PostBotsByBotIdScheduleError, PostBotsByBotIdScheduleErrors, PostBotsByBotIdScheduleResponse, PostBotsByBotIdScheduleResponses, PostBotsByBotIdSettingsData, PostBotsByBotIdSettingsError, PostBotsByBotIdSettingsErrors, PostBotsByBotIdSettingsResponse, PostBotsByBotIdSettingsResponses, PostBotsByBotIdSubagentsByIdSkillsData, PostBotsByBotIdSubagentsByIdSkillsError, PostBotsByBotIdSubagentsByIdSkillsErrors, PostBotsByBotIdSubagentsByIdSkillsResponse, PostBotsByBotIdSubagentsByIdSkillsResponses, PostBotsByBotIdSubagentsData, PostBotsByBotIdSubagentsError, PostBotsByBotIdSubagentsErrors, PostBotsByBotIdSubagentsResponse, PostBotsByBotIdSubagentsResponses, PostBotsByBotIdToolsData, PostBotsByBotIdToolsError, PostBotsByBotIdToolsErrors, PostBotsByBotIdToolsResponse, PostBotsByBotIdToolsResponses, PostBotsByIdChannelByPlatformSendChatData, PostBotsByIdChannelByPlatformSendChatError, PostBotsByIdChannelByPlatformSendChatErrors, PostBotsByIdChannelByPlatformSendChatResponse, PostBotsByIdChannelByPlatformSendChatResponses, PostBotsByIdChannelByPlatformSendData, PostBotsByIdChannelByPlatformSendError, PostBotsByIdChannelByPlatformSendErrors, PostBotsByIdChannelByPlatformSendResponse, PostBotsByIdChannelByPlatformSendResponses, PostBotsData, PostBotsError, PostBotsErrors, PostBotsResponse, PostBotsResponses, PostEmbeddingsData, PostEmbeddingsError, PostEmbeddingsErrors, PostEmbeddingsResponse, PostEmbeddingsResponses, PostModelsData, PostModelsError, PostModelsErrors, PostModelsResponse, PostModelsResponses, PostProvidersData, PostProvidersError, PostProvidersErrors, PostProvidersResponse, PostProvidersResponses, PostSearchProvidersData, PostSearchProvidersError, PostSearchProvidersErrors, PostSearchProvidersResponse, PostSearchProvidersResponses, PostUsersData, PostUsersError, PostUsersErrors, PostUsersResponse, PostUsersResponses, ProvidersClientType, ProvidersCountResponse, ProvidersCreateRequest, ProvidersGetResponse, ProvidersUpdateRequest, PutBotsByBotIdMcpByIdData, PutBotsByBotIdMcpByIdError, PutBotsByBotIdMcpByIdErrors, PutBotsByBotIdMcpByIdResponse, PutBotsByBotIdMcpByIdResponses, PutBotsByBotIdMcpImportData, PutBotsByBotIdMcpImportError, PutBotsByBotIdMcpImportErrors, PutBotsByBotIdMcpImportResponse, PutBotsByBotIdMcpImportResponses, PutBotsByBotIdScheduleByIdData, PutBotsByBotIdScheduleByIdError, PutBotsByBotIdScheduleByIdErrors, PutBotsByBotIdScheduleByIdResponse, PutBotsByBotIdScheduleByIdResponses, PutBotsByBotIdSettingsData, PutBotsByBotIdSettingsError, PutBotsByBotIdSettingsErrors, PutBotsByBotIdSettingsResponse, PutBotsByBotIdSettingsResponses, PutBotsByBotIdSubagentsByIdContextData, PutBotsByBotIdSubagentsByIdContextError, PutBotsByBotIdSubagentsByIdContextErrors, PutBotsByBotIdSubagentsByIdContextResponse, PutBotsByBotIdSubagentsByIdContextResponses, PutBotsByBotIdSubagentsByIdData, PutBotsByBotIdSubagentsByIdError, PutBotsByBotIdSubagentsByIdErrors, PutBotsByBotIdSubagentsByIdResponse, PutBotsByBotIdSubagentsByIdResponses, PutBotsByBotIdSubagentsByIdSkillsData, PutBotsByBotIdSubagentsByIdSkillsError, PutBotsByBotIdSubagentsByIdSkillsErrors, PutBotsByBotIdSubagentsByIdSkillsResponse, PutBotsByBotIdSubagentsByIdSkillsResponses, PutBotsByIdChannelByPlatformData, PutBotsByIdChannelByPlatformError, PutBotsByIdChannelByPlatformErrors, PutBotsByIdChannelByPlatformResponse, PutBotsByIdChannelByPlatformResponses, PutBotsByIdData, PutBotsByIdError, PutBotsByIdErrors, PutBotsByIdMembersData, PutBotsByIdMembersError, PutBotsByIdMembersErrors, PutBotsByIdMembersResponse, PutBotsByIdMembersResponses, PutBotsByIdOwnerData, PutBotsByIdOwnerError, PutBotsByIdOwnerErrors, PutBotsByIdOwnerResponse, PutBotsByIdOwnerResponses, PutBotsByIdResponse, PutBotsByIdResponses, PutModelsByIdData, PutModelsByIdError, PutModelsByIdErrors, PutModelsByIdResponse, PutModelsByIdResponses, PutModelsModelByModelIdData, PutModelsModelByModelIdError, PutModelsModelByModelIdErrors, PutModelsModelByModelIdResponse, PutModelsModelByModelIdResponses, PutProvidersByIdData, PutProvidersByIdError, PutProvidersByIdErrors, PutProvidersByIdResponse, PutProvidersByIdResponses, PutSearchProvidersByIdData, PutSearchProvidersByIdError, PutSearchProvidersByIdErrors, PutSearchProvidersByIdResponse, PutSearchProvidersByIdResponses, PutUsersByIdData, PutUsersByIdError, PutUsersByIdErrors, PutUsersByIdPasswordData, PutUsersByIdPasswordError, PutUsersByIdPasswordErrors, PutUsersByIdPasswordResponses, PutUsersByIdResponse, PutUsersByIdResponses, PutUsersMeChannelsByPlatformData, PutUsersMeChannelsByPlatformError, PutUsersMeChannelsByPlatformErrors, PutUsersMeChannelsByPlatformResponse, PutUsersMeChannelsByPlatformResponses, PutUsersMeData, PutUsersMeError, PutUsersMeErrors, PutUsersMePasswordData, PutUsersMePasswordError, PutUsersMePasswordErrors, PutUsersMePasswordResponses, PutUsersMeResponse, PutUsersMeResponses, ScheduleCreateRequest, ScheduleListResponse, ScheduleNullableInt, ScheduleSchedule, ScheduleUpdateRequest, SearchprovidersCreateRequest, SearchprovidersGetResponse, SearchprovidersProviderConfigSchema, SearchprovidersProviderFieldSchema, SearchprovidersProviderMeta, SearchprovidersProviderName, SearchprovidersUpdateRequest, SettingsSettings, SettingsUpsertRequest, SubagentAddSkillsRequest, SubagentContextResponse, SubagentCreateRequest, SubagentListResponse, SubagentSkillsResponse, SubagentSubagent, SubagentUpdateContextRequest, SubagentUpdateRequest, SubagentUpdateSkillsRequest } from './types.gen'; diff --git a/packages/sdk/src/sdk.gen.ts b/packages/sdk/src/sdk.gen.ts index 934b1989..33c542a7 100644 --- a/packages/sdk/src/sdk.gen.ts +++ b/packages/sdk/src/sdk.gen.ts @@ -2,7 +2,7 @@ import type { Client, Options as Options2, TDataShape } from './client'; import { client } from './client.gen'; -import type { DeleteBotsByBotIdContainerData, DeleteBotsByBotIdContainerErrors, DeleteBotsByBotIdContainerResponses, DeleteBotsByBotIdContainerSkillsData, DeleteBotsByBotIdContainerSkillsErrors, DeleteBotsByBotIdContainerSkillsResponses, DeleteBotsByBotIdMcpByIdData, DeleteBotsByBotIdMcpByIdErrors, DeleteBotsByBotIdMcpByIdResponses, DeleteBotsByBotIdMemoryByIdData, DeleteBotsByBotIdMemoryByIdErrors, DeleteBotsByBotIdMemoryByIdResponses, DeleteBotsByBotIdMemoryData, DeleteBotsByBotIdMemoryErrors, DeleteBotsByBotIdMemoryResponses, DeleteBotsByBotIdScheduleByIdData, DeleteBotsByBotIdScheduleByIdErrors, DeleteBotsByBotIdScheduleByIdResponses, DeleteBotsByBotIdSettingsData, DeleteBotsByBotIdSettingsErrors, DeleteBotsByBotIdSettingsResponses, DeleteBotsByBotIdSubagentsByIdData, DeleteBotsByBotIdSubagentsByIdErrors, DeleteBotsByBotIdSubagentsByIdResponses, DeleteBotsByIdData, DeleteBotsByIdErrors, DeleteBotsByIdMembersByUserIdData, DeleteBotsByIdMembersByUserIdErrors, DeleteBotsByIdMembersByUserIdResponses, DeleteBotsByIdResponses, DeleteModelsByIdData, DeleteModelsByIdErrors, DeleteModelsByIdResponses, DeleteModelsModelByModelIdData, DeleteModelsModelByModelIdErrors, DeleteModelsModelByModelIdResponses, DeleteProvidersByIdData, DeleteProvidersByIdErrors, DeleteProvidersByIdResponses, GetBotsByBotIdContainerData, GetBotsByBotIdContainerErrors, GetBotsByBotIdContainerResponses, GetBotsByBotIdContainerSkillsData, GetBotsByBotIdContainerSkillsErrors, GetBotsByBotIdContainerSkillsResponses, GetBotsByBotIdContainerSnapshotsData, GetBotsByBotIdContainerSnapshotsResponses, GetBotsByBotIdMcpByIdData, GetBotsByBotIdMcpByIdErrors, GetBotsByBotIdMcpByIdResponses, GetBotsByBotIdMcpData, GetBotsByBotIdMcpErrors, GetBotsByBotIdMcpExportData, GetBotsByBotIdMcpExportErrors, GetBotsByBotIdMcpExportResponses, GetBotsByBotIdMcpResponses, GetBotsByBotIdMemoryData, GetBotsByBotIdMemoryErrors, GetBotsByBotIdMemoryResponses, GetBotsByBotIdMemoryUsageData, GetBotsByBotIdMemoryUsageErrors, GetBotsByBotIdMemoryUsageResponses, GetBotsByBotIdMessagesData, GetBotsByBotIdMessagesErrors, GetBotsByBotIdMessagesResponses, GetBotsByBotIdScheduleByIdData, GetBotsByBotIdScheduleByIdErrors, GetBotsByBotIdScheduleByIdResponses, GetBotsByBotIdScheduleData, GetBotsByBotIdScheduleErrors, GetBotsByBotIdScheduleResponses, GetBotsByBotIdSettingsData, GetBotsByBotIdSettingsErrors, GetBotsByBotIdSettingsResponses, GetBotsByBotIdSubagentsByIdContextData, GetBotsByBotIdSubagentsByIdContextErrors, GetBotsByBotIdSubagentsByIdContextResponses, GetBotsByBotIdSubagentsByIdData, GetBotsByBotIdSubagentsByIdErrors, GetBotsByBotIdSubagentsByIdResponses, GetBotsByBotIdSubagentsByIdSkillsData, GetBotsByBotIdSubagentsByIdSkillsErrors, GetBotsByBotIdSubagentsByIdSkillsResponses, GetBotsByBotIdSubagentsData, GetBotsByBotIdSubagentsErrors, GetBotsByBotIdSubagentsResponses, GetBotsByIdChannelByPlatformData, GetBotsByIdChannelByPlatformErrors, GetBotsByIdChannelByPlatformResponses, GetBotsByIdChecksData, GetBotsByIdChecksErrors, GetBotsByIdChecksKeysData, GetBotsByIdChecksKeysResponses, GetBotsByIdChecksResponses, GetBotsByIdChecksRunByKeyData, GetBotsByIdChecksRunByKeyResponses, GetBotsByIdData, GetBotsByIdErrors, GetBotsByIdMembersData, GetBotsByIdMembersErrors, GetBotsByIdMembersResponses, GetBotsByIdResponses, GetBotsData, GetBotsErrors, GetBotsResponses, GetChannelsByPlatformData, GetChannelsByPlatformErrors, GetChannelsByPlatformResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetModelsByIdData, GetModelsByIdErrors, GetModelsByIdResponses, GetModelsCountData, GetModelsCountErrors, GetModelsCountResponses, GetModelsData, GetModelsErrors, GetModelsModelByModelIdData, GetModelsModelByModelIdErrors, GetModelsModelByModelIdResponses, GetModelsResponses, GetProvidersByIdData, GetProvidersByIdErrors, GetProvidersByIdModelsData, GetProvidersByIdModelsErrors, GetProvidersByIdModelsResponses, GetProvidersByIdResponses, GetProvidersCountData, GetProvidersCountErrors, GetProvidersCountResponses, GetProvidersData, GetProvidersErrors, GetProvidersNameByNameData, GetProvidersNameByNameErrors, GetProvidersNameByNameResponses, GetProvidersResponses, GetUsersByIdData, GetUsersByIdErrors, GetUsersByIdResponses, GetUsersData, GetUsersErrors, GetUsersMeChannelsByPlatformData, GetUsersMeChannelsByPlatformErrors, GetUsersMeChannelsByPlatformResponses, GetUsersMeData, GetUsersMeErrors, GetUsersMeIdentitiesData, GetUsersMeIdentitiesErrors, GetUsersMeIdentitiesResponses, GetUsersMeResponses, GetUsersResponses, PostAuthLoginData, PostAuthLoginErrors, PostAuthLoginResponses, PostBotsByBotIdContainerData, PostBotsByBotIdContainerErrors, PostBotsByBotIdContainerResponses, PostBotsByBotIdContainerSkillsData, PostBotsByBotIdContainerSkillsErrors, PostBotsByBotIdContainerSkillsResponses, PostBotsByBotIdContainerSnapshotsData, PostBotsByBotIdContainerSnapshotsErrors, PostBotsByBotIdContainerSnapshotsResponses, PostBotsByBotIdContainerStartData, PostBotsByBotIdContainerStartErrors, PostBotsByBotIdContainerStartResponses, PostBotsByBotIdContainerStopData, PostBotsByBotIdContainerStopErrors, PostBotsByBotIdContainerStopResponses, PostBotsByBotIdMcpData, PostBotsByBotIdMcpErrors, PostBotsByBotIdMcpOpsBatchDeleteData, PostBotsByBotIdMcpOpsBatchDeleteErrors, PostBotsByBotIdMcpOpsBatchDeleteResponses, PostBotsByBotIdMcpResponses, PostBotsByBotIdMcpStdioByConnectionIdData, PostBotsByBotIdMcpStdioByConnectionIdErrors, PostBotsByBotIdMcpStdioByConnectionIdResponses, PostBotsByBotIdMcpStdioData, PostBotsByBotIdMcpStdioErrors, PostBotsByBotIdMcpStdioResponses, PostBotsByBotIdMemoryCompactData, PostBotsByBotIdMemoryCompactErrors, PostBotsByBotIdMemoryCompactResponses, PostBotsByBotIdMemoryData, PostBotsByBotIdMemoryErrors, PostBotsByBotIdMemoryRebuildData, PostBotsByBotIdMemoryRebuildErrors, PostBotsByBotIdMemoryRebuildResponses, PostBotsByBotIdMemoryResponses, PostBotsByBotIdMemorySearchData, PostBotsByBotIdMemorySearchErrors, PostBotsByBotIdMemorySearchResponses, PostBotsByBotIdScheduleData, PostBotsByBotIdScheduleErrors, PostBotsByBotIdScheduleResponses, PostBotsByBotIdSettingsData, PostBotsByBotIdSettingsErrors, PostBotsByBotIdSettingsResponses, PostBotsByBotIdSubagentsByIdSkillsData, PostBotsByBotIdSubagentsByIdSkillsErrors, PostBotsByBotIdSubagentsByIdSkillsResponses, PostBotsByBotIdSubagentsData, PostBotsByBotIdSubagentsErrors, PostBotsByBotIdSubagentsResponses, PostBotsByBotIdToolsData, PostBotsByBotIdToolsErrors, PostBotsByBotIdToolsResponses, PostBotsByIdChannelByPlatformSendChatData, PostBotsByIdChannelByPlatformSendChatErrors, PostBotsByIdChannelByPlatformSendChatResponses, PostBotsByIdChannelByPlatformSendData, PostBotsByIdChannelByPlatformSendErrors, PostBotsByIdChannelByPlatformSendResponses, PostBotsData, PostBotsErrors, PostBotsResponses, PostEmbeddingsData, PostEmbeddingsErrors, PostEmbeddingsResponses, PostModelsData, PostModelsErrors, PostModelsResponses, PostProvidersData, PostProvidersErrors, PostProvidersResponses, PostUsersData, PostUsersErrors, PostUsersResponses, PutBotsByBotIdMcpByIdData, PutBotsByBotIdMcpByIdErrors, PutBotsByBotIdMcpByIdResponses, PutBotsByBotIdMcpImportData, PutBotsByBotIdMcpImportErrors, PutBotsByBotIdMcpImportResponses, PutBotsByBotIdScheduleByIdData, PutBotsByBotIdScheduleByIdErrors, PutBotsByBotIdScheduleByIdResponses, PutBotsByBotIdSettingsData, PutBotsByBotIdSettingsErrors, PutBotsByBotIdSettingsResponses, PutBotsByBotIdSubagentsByIdContextData, PutBotsByBotIdSubagentsByIdContextErrors, PutBotsByBotIdSubagentsByIdContextResponses, PutBotsByBotIdSubagentsByIdData, PutBotsByBotIdSubagentsByIdErrors, PutBotsByBotIdSubagentsByIdResponses, PutBotsByBotIdSubagentsByIdSkillsData, PutBotsByBotIdSubagentsByIdSkillsErrors, PutBotsByBotIdSubagentsByIdSkillsResponses, PutBotsByIdChannelByPlatformData, PutBotsByIdChannelByPlatformErrors, PutBotsByIdChannelByPlatformResponses, PutBotsByIdData, PutBotsByIdErrors, PutBotsByIdMembersData, PutBotsByIdMembersErrors, PutBotsByIdMembersResponses, PutBotsByIdOwnerData, PutBotsByIdOwnerErrors, PutBotsByIdOwnerResponses, PutBotsByIdResponses, PutModelsByIdData, PutModelsByIdErrors, PutModelsByIdResponses, PutModelsModelByModelIdData, PutModelsModelByModelIdErrors, PutModelsModelByModelIdResponses, PutProvidersByIdData, PutProvidersByIdErrors, PutProvidersByIdResponses, PutUsersByIdData, PutUsersByIdErrors, PutUsersByIdPasswordData, PutUsersByIdPasswordErrors, PutUsersByIdPasswordResponses, PutUsersByIdResponses, PutUsersMeChannelsByPlatformData, PutUsersMeChannelsByPlatformErrors, PutUsersMeChannelsByPlatformResponses, PutUsersMeData, PutUsersMeErrors, PutUsersMePasswordData, PutUsersMePasswordErrors, PutUsersMePasswordResponses, PutUsersMeResponses } from './types.gen'; +import type { DeleteBotsByBotIdContainerData, DeleteBotsByBotIdContainerErrors, DeleteBotsByBotIdContainerResponses, DeleteBotsByBotIdContainerSkillsData, DeleteBotsByBotIdContainerSkillsErrors, DeleteBotsByBotIdContainerSkillsResponses, DeleteBotsByBotIdMcpByIdData, DeleteBotsByBotIdMcpByIdErrors, DeleteBotsByBotIdMcpByIdResponses, DeleteBotsByBotIdMemoryByIdData, DeleteBotsByBotIdMemoryByIdErrors, DeleteBotsByBotIdMemoryByIdResponses, DeleteBotsByBotIdMemoryData, DeleteBotsByBotIdMemoryErrors, DeleteBotsByBotIdMemoryResponses, DeleteBotsByBotIdScheduleByIdData, DeleteBotsByBotIdScheduleByIdErrors, DeleteBotsByBotIdScheduleByIdResponses, DeleteBotsByBotIdSettingsData, DeleteBotsByBotIdSettingsErrors, DeleteBotsByBotIdSettingsResponses, DeleteBotsByBotIdSubagentsByIdData, DeleteBotsByBotIdSubagentsByIdErrors, DeleteBotsByBotIdSubagentsByIdResponses, DeleteBotsByIdData, DeleteBotsByIdErrors, DeleteBotsByIdMembersByUserIdData, DeleteBotsByIdMembersByUserIdErrors, DeleteBotsByIdMembersByUserIdResponses, DeleteBotsByIdResponses, DeleteModelsByIdData, DeleteModelsByIdErrors, DeleteModelsByIdResponses, DeleteModelsModelByModelIdData, DeleteModelsModelByModelIdErrors, DeleteModelsModelByModelIdResponses, DeleteProvidersByIdData, DeleteProvidersByIdErrors, DeleteProvidersByIdResponses, DeleteSearchProvidersByIdData, DeleteSearchProvidersByIdErrors, DeleteSearchProvidersByIdResponses, GetBotsByBotIdContainerData, GetBotsByBotIdContainerErrors, GetBotsByBotIdContainerResponses, GetBotsByBotIdContainerSkillsData, GetBotsByBotIdContainerSkillsErrors, GetBotsByBotIdContainerSkillsResponses, GetBotsByBotIdContainerSnapshotsData, GetBotsByBotIdContainerSnapshotsResponses, GetBotsByBotIdMcpByIdData, GetBotsByBotIdMcpByIdErrors, GetBotsByBotIdMcpByIdResponses, GetBotsByBotIdMcpData, GetBotsByBotIdMcpErrors, GetBotsByBotIdMcpExportData, GetBotsByBotIdMcpExportErrors, GetBotsByBotIdMcpExportResponses, GetBotsByBotIdMcpResponses, GetBotsByBotIdMemoryData, GetBotsByBotIdMemoryErrors, GetBotsByBotIdMemoryResponses, GetBotsByBotIdMemoryUsageData, GetBotsByBotIdMemoryUsageErrors, GetBotsByBotIdMemoryUsageResponses, GetBotsByBotIdMessagesData, GetBotsByBotIdMessagesErrors, GetBotsByBotIdMessagesResponses, GetBotsByBotIdScheduleByIdData, GetBotsByBotIdScheduleByIdErrors, GetBotsByBotIdScheduleByIdResponses, GetBotsByBotIdScheduleData, GetBotsByBotIdScheduleErrors, GetBotsByBotIdScheduleResponses, GetBotsByBotIdSettingsData, GetBotsByBotIdSettingsErrors, GetBotsByBotIdSettingsResponses, GetBotsByBotIdSubagentsByIdContextData, GetBotsByBotIdSubagentsByIdContextErrors, GetBotsByBotIdSubagentsByIdContextResponses, GetBotsByBotIdSubagentsByIdData, GetBotsByBotIdSubagentsByIdErrors, GetBotsByBotIdSubagentsByIdResponses, GetBotsByBotIdSubagentsByIdSkillsData, GetBotsByBotIdSubagentsByIdSkillsErrors, GetBotsByBotIdSubagentsByIdSkillsResponses, GetBotsByBotIdSubagentsData, GetBotsByBotIdSubagentsErrors, GetBotsByBotIdSubagentsResponses, GetBotsByIdChannelByPlatformData, GetBotsByIdChannelByPlatformErrors, GetBotsByIdChannelByPlatformResponses, GetBotsByIdChecksData, GetBotsByIdChecksErrors, GetBotsByIdChecksKeysData, GetBotsByIdChecksKeysResponses, GetBotsByIdChecksResponses, GetBotsByIdChecksRunByKeyData, GetBotsByIdChecksRunByKeyResponses, GetBotsByIdData, GetBotsByIdErrors, GetBotsByIdMembersData, GetBotsByIdMembersErrors, GetBotsByIdMembersResponses, GetBotsByIdResponses, GetBotsData, GetBotsErrors, GetBotsResponses, GetChannelsByPlatformData, GetChannelsByPlatformErrors, GetChannelsByPlatformResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetModelsByIdData, GetModelsByIdErrors, GetModelsByIdResponses, GetModelsCountData, GetModelsCountErrors, GetModelsCountResponses, GetModelsData, GetModelsErrors, GetModelsModelByModelIdData, GetModelsModelByModelIdErrors, GetModelsModelByModelIdResponses, GetModelsResponses, GetProvidersByIdData, GetProvidersByIdErrors, GetProvidersByIdModelsData, GetProvidersByIdModelsErrors, GetProvidersByIdModelsResponses, GetProvidersByIdResponses, GetProvidersCountData, GetProvidersCountErrors, GetProvidersCountResponses, GetProvidersData, GetProvidersErrors, GetProvidersNameByNameData, GetProvidersNameByNameErrors, GetProvidersNameByNameResponses, GetProvidersResponses, GetSearchProvidersByIdData, GetSearchProvidersByIdErrors, GetSearchProvidersByIdResponses, GetSearchProvidersData, GetSearchProvidersErrors, GetSearchProvidersMetaData, GetSearchProvidersMetaResponses, GetSearchProvidersResponses, GetUsersByIdData, GetUsersByIdErrors, GetUsersByIdResponses, GetUsersData, GetUsersErrors, GetUsersMeChannelsByPlatformData, GetUsersMeChannelsByPlatformErrors, GetUsersMeChannelsByPlatformResponses, GetUsersMeData, GetUsersMeErrors, GetUsersMeIdentitiesData, GetUsersMeIdentitiesErrors, GetUsersMeIdentitiesResponses, GetUsersMeResponses, GetUsersResponses, PostAuthLoginData, PostAuthLoginErrors, PostAuthLoginResponses, PostBotsByBotIdContainerData, PostBotsByBotIdContainerErrors, PostBotsByBotIdContainerResponses, PostBotsByBotIdContainerSkillsData, PostBotsByBotIdContainerSkillsErrors, PostBotsByBotIdContainerSkillsResponses, PostBotsByBotIdContainerSnapshotsData, PostBotsByBotIdContainerSnapshotsErrors, PostBotsByBotIdContainerSnapshotsResponses, PostBotsByBotIdContainerStartData, PostBotsByBotIdContainerStartErrors, PostBotsByBotIdContainerStartResponses, PostBotsByBotIdContainerStopData, PostBotsByBotIdContainerStopErrors, PostBotsByBotIdContainerStopResponses, PostBotsByBotIdMcpData, PostBotsByBotIdMcpErrors, PostBotsByBotIdMcpOpsBatchDeleteData, PostBotsByBotIdMcpOpsBatchDeleteErrors, PostBotsByBotIdMcpOpsBatchDeleteResponses, PostBotsByBotIdMcpResponses, PostBotsByBotIdMcpStdioByConnectionIdData, PostBotsByBotIdMcpStdioByConnectionIdErrors, PostBotsByBotIdMcpStdioByConnectionIdResponses, PostBotsByBotIdMcpStdioData, PostBotsByBotIdMcpStdioErrors, PostBotsByBotIdMcpStdioResponses, PostBotsByBotIdMemoryCompactData, PostBotsByBotIdMemoryCompactErrors, PostBotsByBotIdMemoryCompactResponses, PostBotsByBotIdMemoryData, PostBotsByBotIdMemoryErrors, PostBotsByBotIdMemoryRebuildData, PostBotsByBotIdMemoryRebuildErrors, PostBotsByBotIdMemoryRebuildResponses, PostBotsByBotIdMemoryResponses, PostBotsByBotIdMemorySearchData, PostBotsByBotIdMemorySearchErrors, PostBotsByBotIdMemorySearchResponses, PostBotsByBotIdScheduleData, PostBotsByBotIdScheduleErrors, PostBotsByBotIdScheduleResponses, PostBotsByBotIdSettingsData, PostBotsByBotIdSettingsErrors, PostBotsByBotIdSettingsResponses, PostBotsByBotIdSubagentsByIdSkillsData, PostBotsByBotIdSubagentsByIdSkillsErrors, PostBotsByBotIdSubagentsByIdSkillsResponses, PostBotsByBotIdSubagentsData, PostBotsByBotIdSubagentsErrors, PostBotsByBotIdSubagentsResponses, PostBotsByBotIdToolsData, PostBotsByBotIdToolsErrors, PostBotsByBotIdToolsResponses, PostBotsByIdChannelByPlatformSendChatData, PostBotsByIdChannelByPlatformSendChatErrors, PostBotsByIdChannelByPlatformSendChatResponses, PostBotsByIdChannelByPlatformSendData, PostBotsByIdChannelByPlatformSendErrors, PostBotsByIdChannelByPlatformSendResponses, PostBotsData, PostBotsErrors, PostBotsResponses, PostEmbeddingsData, PostEmbeddingsErrors, PostEmbeddingsResponses, PostModelsData, PostModelsErrors, PostModelsResponses, PostProvidersData, PostProvidersErrors, PostProvidersResponses, PostSearchProvidersData, PostSearchProvidersErrors, PostSearchProvidersResponses, PostUsersData, PostUsersErrors, PostUsersResponses, PutBotsByBotIdMcpByIdData, PutBotsByBotIdMcpByIdErrors, PutBotsByBotIdMcpByIdResponses, PutBotsByBotIdMcpImportData, PutBotsByBotIdMcpImportErrors, PutBotsByBotIdMcpImportResponses, PutBotsByBotIdScheduleByIdData, PutBotsByBotIdScheduleByIdErrors, PutBotsByBotIdScheduleByIdResponses, PutBotsByBotIdSettingsData, PutBotsByBotIdSettingsErrors, PutBotsByBotIdSettingsResponses, PutBotsByBotIdSubagentsByIdContextData, PutBotsByBotIdSubagentsByIdContextErrors, PutBotsByBotIdSubagentsByIdContextResponses, PutBotsByBotIdSubagentsByIdData, PutBotsByBotIdSubagentsByIdErrors, PutBotsByBotIdSubagentsByIdResponses, PutBotsByBotIdSubagentsByIdSkillsData, PutBotsByBotIdSubagentsByIdSkillsErrors, PutBotsByBotIdSubagentsByIdSkillsResponses, PutBotsByIdChannelByPlatformData, PutBotsByIdChannelByPlatformErrors, PutBotsByIdChannelByPlatformResponses, PutBotsByIdData, PutBotsByIdErrors, PutBotsByIdMembersData, PutBotsByIdMembersErrors, PutBotsByIdMembersResponses, PutBotsByIdOwnerData, PutBotsByIdOwnerErrors, PutBotsByIdOwnerResponses, PutBotsByIdResponses, PutModelsByIdData, PutModelsByIdErrors, PutModelsByIdResponses, PutModelsModelByModelIdData, PutModelsModelByModelIdErrors, PutModelsModelByModelIdResponses, PutProvidersByIdData, PutProvidersByIdErrors, PutProvidersByIdResponses, PutSearchProvidersByIdData, PutSearchProvidersByIdErrors, PutSearchProvidersByIdResponses, PutUsersByIdData, PutUsersByIdErrors, PutUsersByIdPasswordData, PutUsersByIdPasswordErrors, PutUsersByIdPasswordResponses, PutUsersByIdResponses, PutUsersMeChannelsByPlatformData, PutUsersMeChannelsByPlatformErrors, PutUsersMeChannelsByPlatformResponses, PutUsersMeData, PutUsersMeErrors, PutUsersMePasswordData, PutUsersMePasswordErrors, PutUsersMePasswordResponses, PutUsersMeResponses } from './types.gen'; export type Options = Options2 & { /** @@ -873,6 +873,62 @@ export const putProvidersById = (options: */ export const getProvidersByIdModels = (options: Options) => (options.client ?? client).get({ url: '/providers/{id}/models', ...options }); +/** + * List search providers + * + * List configured search providers + */ +export const getSearchProviders = (options?: Options) => (options?.client ?? client).get({ url: '/search-providers', ...options }); + +/** + * Create a search provider + * + * Create a search provider configuration + */ +export const postSearchProviders = (options: Options) => (options.client ?? client).post({ + url: '/search-providers', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * List search provider metadata + * + * List available search provider types and config schemas + */ +export const getSearchProvidersMeta = (options?: Options) => (options?.client ?? client).get({ url: '/search-providers/meta', ...options }); + +/** + * Delete a search provider + * + * Delete search provider by ID + */ +export const deleteSearchProvidersById = (options: Options) => (options.client ?? client).delete({ url: '/search-providers/{id}', ...options }); + +/** + * Get a search provider + * + * Get search provider by ID + */ +export const getSearchProvidersById = (options: Options) => (options.client ?? client).get({ url: '/search-providers/{id}', ...options }); + +/** + * Update a search provider + * + * Update search provider by ID + */ +export const putSearchProvidersById = (options: Options) => (options.client ?? client).put({ + url: '/search-providers/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + /** * List users (admin only) * diff --git a/packages/sdk/src/types.gen.ts b/packages/sdk/src/types.gen.ts index 2effa732..9c0acbde 100644 --- a/packages/sdk/src/types.gen.ts +++ b/packages/sdk/src/types.gen.ts @@ -790,6 +790,56 @@ export type ScheduleUpdateRequest = { pattern?: string; }; +export type SearchprovidersCreateRequest = { + config?: { + [key: string]: unknown; + }; + name?: string; + provider?: SearchprovidersProviderName; +}; + +export type SearchprovidersGetResponse = { + config?: { + [key: string]: unknown; + }; + created_at?: string; + id?: string; + name?: string; + provider?: string; + updated_at?: string; +}; + +export type SearchprovidersProviderConfigSchema = { + fields?: { + [key: string]: SearchprovidersProviderFieldSchema; + }; +}; + +export type SearchprovidersProviderFieldSchema = { + description?: string; + enum?: Array; + example?: unknown; + required?: boolean; + title?: string; + type?: string; +}; + +export type SearchprovidersProviderMeta = { + config_schema?: SearchprovidersProviderConfigSchema; + display_name?: string; + provider?: string; +}; + +export type SearchprovidersProviderName = 'brave'; + +export type SearchprovidersUpdateRequest = { + config?: { + [key: string]: unknown; + }; + name?: string; + provider?: SearchprovidersProviderName; +}; + export type SettingsSettings = { allow_guest?: boolean; chat_model_id?: string; @@ -797,6 +847,7 @@ export type SettingsSettings = { language?: string; max_context_load_time?: number; memory_model_id?: string; + search_provider_id?: string; }; export type SettingsUpsertRequest = { @@ -806,6 +857,7 @@ export type SettingsUpsertRequest = { language?: string; max_context_load_time?: number; memory_model_id?: string; + search_provider_id?: string; }; export type SubagentAddSkillsRequest = { @@ -4174,6 +4226,187 @@ export type GetProvidersByIdModelsResponses = { export type GetProvidersByIdModelsResponse = GetProvidersByIdModelsResponses[keyof GetProvidersByIdModelsResponses]; +export type GetSearchProvidersData = { + body?: never; + path?: never; + query?: { + /** + * Provider filter (brave) + */ + provider?: string; + }; + url: '/search-providers'; +}; + +export type GetSearchProvidersErrors = { + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetSearchProvidersError = GetSearchProvidersErrors[keyof GetSearchProvidersErrors]; + +export type GetSearchProvidersResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GetSearchProvidersResponse = GetSearchProvidersResponses[keyof GetSearchProvidersResponses]; + +export type PostSearchProvidersData = { + /** + * Search provider configuration + */ + body: SearchprovidersCreateRequest; + path?: never; + query?: never; + url: '/search-providers'; +}; + +export type PostSearchProvidersErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostSearchProvidersError = PostSearchProvidersErrors[keyof PostSearchProvidersErrors]; + +export type PostSearchProvidersResponses = { + /** + * Created + */ + 201: SearchprovidersGetResponse; +}; + +export type PostSearchProvidersResponse = PostSearchProvidersResponses[keyof PostSearchProvidersResponses]; + +export type GetSearchProvidersMetaData = { + body?: never; + path?: never; + query?: never; + url: '/search-providers/meta'; +}; + +export type GetSearchProvidersMetaResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GetSearchProvidersMetaResponse = GetSearchProvidersMetaResponses[keyof GetSearchProvidersMetaResponses]; + +export type DeleteSearchProvidersByIdData = { + body?: never; + path: { + /** + * Provider ID + */ + id: string; + }; + query?: never; + url: '/search-providers/{id}'; +}; + +export type DeleteSearchProvidersByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteSearchProvidersByIdError = DeleteSearchProvidersByIdErrors[keyof DeleteSearchProvidersByIdErrors]; + +export type DeleteSearchProvidersByIdResponses = { + /** + * No Content + */ + 204: unknown; +}; + +export type GetSearchProvidersByIdData = { + body?: never; + path: { + /** + * Provider ID + */ + id: string; + }; + query?: never; + url: '/search-providers/{id}'; +}; + +export type GetSearchProvidersByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; +}; + +export type GetSearchProvidersByIdError = GetSearchProvidersByIdErrors[keyof GetSearchProvidersByIdErrors]; + +export type GetSearchProvidersByIdResponses = { + /** + * OK + */ + 200: SearchprovidersGetResponse; +}; + +export type GetSearchProvidersByIdResponse = GetSearchProvidersByIdResponses[keyof GetSearchProvidersByIdResponses]; + +export type PutSearchProvidersByIdData = { + /** + * Updated configuration + */ + body: SearchprovidersUpdateRequest; + path: { + /** + * Provider ID + */ + id: string; + }; + query?: never; + url: '/search-providers/{id}'; +}; + +export type PutSearchProvidersByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutSearchProvidersByIdError = PutSearchProvidersByIdErrors[keyof PutSearchProvidersByIdErrors]; + +export type PutSearchProvidersByIdResponses = { + /** + * OK + */ + 200: SearchprovidersGetResponse; +}; + +export type PutSearchProvidersByIdResponse = PutSearchProvidersByIdResponses[keyof PutSearchProvidersByIdResponses]; + export type GetUsersData = { body?: never; path?: never; diff --git a/packages/web/src/components/search-provider-logo/icons.ts b/packages/web/src/components/search-provider-logo/icons.ts new file mode 100644 index 00000000..a73c7986 --- /dev/null +++ b/packages/web/src/components/search-provider-logo/icons.ts @@ -0,0 +1,21 @@ +/** + * Search provider icon registry (FontAwesome). + * + * To add a new provider icon: + * 1. Find the icon in FontAwesome (https://fontawesome.com/icons) + * 2. Import it in `main.ts` and add to `library.add()` + * 3. Add the [prefix, iconName] tuple to PROVIDER_ICONS below + * + * The key must match the `provider` field stored in the database (lowercase). + */ + +const PROVIDER_ICONS: Record = { + brave: ['fab', 'brave'], +} + +const DEFAULT_ICON: [string, string] = ['fas', 'globe'] + +export function getSearchProviderIcon(provider: string): [string, string] { + if (!provider) return DEFAULT_ICON + return PROVIDER_ICONS[provider.trim().toLowerCase()] ?? DEFAULT_ICON +} diff --git a/packages/web/src/components/search-provider-logo/index.vue b/packages/web/src/components/search-provider-logo/index.vue new file mode 100644 index 00000000..de57fbcf --- /dev/null +++ b/packages/web/src/components/search-provider-logo/index.vue @@ -0,0 +1,33 @@ + + + diff --git a/packages/web/src/components/sidebar/index.vue b/packages/web/src/components/sidebar/index.vue index c9d71c8b..09b65de9 100644 --- a/packages/web/src/components/sidebar/index.vue +++ b/packages/web/src/components/sidebar/index.vue @@ -135,6 +135,11 @@ const sidebarInfo = computed(() => [ name: 'models', icon: ['fas', 'cubes'], }, + { + title: t('sidebar.searchProvider'), + name: 'search-providers', + icon: ['fas', 'globe'], + }, { title: t('sidebar.settings'), name: 'settings', diff --git a/packages/web/src/i18n/locales/en.json b/packages/web/src/i18n/locales/en.json index c8b775bc..0821054d 100644 --- a/packages/web/src/i18n/locales/en.json +++ b/packages/web/src/i18n/locales/en.json @@ -33,7 +33,8 @@ "status": "Status", "loadFailed": "Failed to load", "saveFailed": "Failed to save", - "createdAt": "Created at" + "createdAt": "Created at", + "none": "None" }, "auth": { "welcome": "Welcome Back", @@ -52,6 +53,7 @@ "chat": "Chat", "bots": "Bots", "models": "Models", + "searchProvider": "Search Providers", "settings": "Settings", "home": "Home", "mcp": "MCP", @@ -161,6 +163,21 @@ "emptyTitle": "No Providers", "emptyDescription": "Add a model provider first to configure models" }, + "searchProvider": { + "title": "Search Providers", + "add": "Add Search Provider", + "empty": "No search providers", + "provider": "Provider Type", + "selectHint": "Select or create a search provider", + "unsupportedProvider": "This provider does not have a settings panel yet", + "saveSuccess": "Search provider saved", + "deleteSuccess": "Search provider deleted", + "deleteFailed": "Failed to delete search provider", + "searchPlaceholder": "Search providers...", + "emptyTitle": "No Search Providers", + "emptyDescription": "Add a search provider to configure web search", + "deleteConfirm": "Are you sure you want to delete this search provider? This action cannot be undone." + }, "mcp": { "addTitle": "Add MCP", "addDescription": "Configure MCP server connection", @@ -317,6 +334,8 @@ "chatModel": "Chat Model", "memoryModel": "Memory Model", "embeddingModel": "Embedding Model", + "searchProvider": "Search Provider", + "searchProviderPlaceholder": "Select search provider", "maxContextLoadTime": "Max Context Load Time", "language": "Language", "allowGuest": "Allow Guest Access", diff --git a/packages/web/src/i18n/locales/zh.json b/packages/web/src/i18n/locales/zh.json index 72dc73a5..f1d363db 100644 --- a/packages/web/src/i18n/locales/zh.json +++ b/packages/web/src/i18n/locales/zh.json @@ -33,7 +33,8 @@ "status": "状态", "loadFailed": "加载失败", "saveFailed": "保存失败", - "createdAt": "创建时间" + "createdAt": "创建时间", + "none": "无" }, "auth": { "welcome": "欢迎回来", @@ -52,6 +53,7 @@ "chat": "对话", "bots": "Bots", "models": "模型管理", + "searchProvider": "搜索提供方", "settings": "设置", "home": "首页", "mcp": "MCP", @@ -157,6 +159,21 @@ "emptyTitle": "暂无服务商", "emptyDescription": "请先添加模型服务商,才能配置模型" }, + "searchProvider": { + "title": "搜索提供方", + "add": "添加搜索提供方", + "empty": "暂无搜索提供方", + "provider": "提供方类型", + "selectHint": "请选择或新建一个搜索提供方", + "unsupportedProvider": "该提供方暂未实现配置面板", + "saveSuccess": "搜索提供方配置已保存", + "deleteSuccess": "搜索提供方配置已删除", + "deleteFailed": "删除搜索提供方配置失败", + "searchPlaceholder": "搜索提供方…", + "emptyTitle": "暂无搜索提供方", + "emptyDescription": "请先添加搜索提供方,才能配置搜索功能", + "deleteConfirm": "确定删除该搜索提供方?删除后无法恢复。" + }, "mcp": { "addTitle": "添加 MCP", "addDescription": "配置 MCP 服务器连接", @@ -313,6 +330,8 @@ "chatModel": "对话模型", "memoryModel": "记忆模型", "embeddingModel": "向量模型", + "searchProvider": "搜索提供方", + "searchProviderPlaceholder": "选择搜索提供方", "maxContextLoadTime": "最大上下文加载时间", "language": "语言", "allowGuest": "允许游客访问", diff --git a/packages/web/src/main.ts b/packages/web/src/main.ts index 29a04750..4ddefeaf 100644 --- a/packages/web/src/main.ts +++ b/packages/web/src/main.ts @@ -52,7 +52,7 @@ import { faComments, faComment, } from '@fortawesome/free-regular-svg-icons' -import { faSlack } from '@fortawesome/free-brands-svg-icons' +import { faSlack, faBrave } from '@fortawesome/free-brands-svg-icons' library.add( faGear, @@ -88,6 +88,7 @@ library.add( faComments, faComment, faSlack, + faBrave, ) createApp(App) diff --git a/packages/web/src/pages/bots/components/bot-settings.vue b/packages/web/src/pages/bots/components/bot-settings.vue index ab200317..76abaf60 100644 --- a/packages/web/src/pages/bots/components/bot-settings.vue +++ b/packages/web/src/pages/bots/components/bot-settings.vue @@ -36,6 +36,16 @@ /> + +
+ + +
+ @@ -129,8 +139,9 @@ import { toast } from 'vue-sonner' import { useI18n } from 'vue-i18n' import ConfirmPopover from '@/components/confirm-popover/index.vue' import ModelSelect from './model-select.vue' +import SearchProviderSelect from './search-provider-select.vue' import { useQuery, useMutation, useQueryCache } from '@pinia/colada' -import { getBotsByBotIdSettings, putBotsByBotIdSettings, deleteBotsById, getModels, getProviders } from '@memoh/sdk' +import { getBotsByBotIdSettings, putBotsByBotIdSettings, deleteBotsById, getModels, getProviders, getSearchProviders } from '@memoh/sdk' import type { SettingsSettings } from '@memoh/sdk' import type { Ref } from 'vue' @@ -174,6 +185,14 @@ const { data: providerData } = useQuery({ }, }) +const { data: searchProviderData } = useQuery({ + key: ['all-search-providers'], + query: async () => { + const { data } = await getSearchProviders({ throwOnError: true }) + return data + }, +}) + const { mutateAsync: updateSettings, isLoading } = useMutation({ mutation: async (body: Partial) => { const { data } = await putBotsByBotIdSettings({ @@ -198,12 +217,14 @@ const { mutateAsync: deleteBot, isLoading: deleteLoading } = useMutation({ const models = computed(() => modelData.value ?? []) const providers = computed(() => providerData.value ?? []) +const searchProviders = computed(() => searchProviderData.value ?? []) // ---- Form ---- const form = reactive({ chat_model_id: '', memory_model_id: '', embedding_model_id: '', + search_provider_id: '', max_context_load_time: 0, language: '', allow_guest: false, @@ -215,6 +236,7 @@ watch(settings, (val) => { form.chat_model_id = val.chat_model_id ?? '' form.memory_model_id = val.memory_model_id ?? '' form.embedding_model_id = val.embedding_model_id ?? '' + form.search_provider_id = val.search_provider_id ?? '' form.max_context_load_time = val.max_context_load_time ?? 0 form.language = val.language ?? '' form.allow_guest = val.allow_guest ?? false @@ -228,6 +250,7 @@ const hasChanges = computed(() => { form.chat_model_id !== (s.chat_model_id ?? '') || form.memory_model_id !== (s.memory_model_id ?? '') || form.embedding_model_id !== (s.embedding_model_id ?? '') + || form.search_provider_id !== (s.search_provider_id ?? '') || form.max_context_load_time !== (s.max_context_load_time ?? 0) || form.language !== (s.language ?? '') if (isPublicBot.value) { diff --git a/packages/web/src/pages/bots/components/search-provider-select.vue b/packages/web/src/pages/bots/components/search-provider-select.vue new file mode 100644 index 00000000..cc107203 --- /dev/null +++ b/packages/web/src/pages/bots/components/search-provider-select.vue @@ -0,0 +1,163 @@ + + + diff --git a/packages/web/src/pages/search-providers/components/add-search-provider.vue b/packages/web/src/pages/search-providers/components/add-search-provider.vue new file mode 100644 index 00000000..72875bfd --- /dev/null +++ b/packages/web/src/pages/search-providers/components/add-search-provider.vue @@ -0,0 +1,155 @@ + + + diff --git a/packages/web/src/pages/search-providers/components/brave-settings.vue b/packages/web/src/pages/search-providers/components/brave-settings.vue new file mode 100644 index 00000000..670418cb --- /dev/null +++ b/packages/web/src/pages/search-providers/components/brave-settings.vue @@ -0,0 +1,54 @@ + + + diff --git a/packages/web/src/pages/search-providers/components/provider-setting.vue b/packages/web/src/pages/search-providers/components/provider-setting.vue new file mode 100644 index 00000000..d6a50af1 --- /dev/null +++ b/packages/web/src/pages/search-providers/components/provider-setting.vue @@ -0,0 +1,196 @@ + + + diff --git a/packages/web/src/pages/search-providers/index.vue b/packages/web/src/pages/search-providers/index.vue new file mode 100644 index 00000000..5b6485db --- /dev/null +++ b/packages/web/src/pages/search-providers/index.vue @@ -0,0 +1,191 @@ + + + diff --git a/packages/web/src/router.ts b/packages/web/src/router.ts index 1dd87577..7d8630d7 100644 --- a/packages/web/src/router.ts +++ b/packages/web/src/router.ts @@ -59,6 +59,14 @@ const routes = [ breadcrumb: i18nRef('sidebar.models'), }, }, + { + name: 'search-providers', + path: '/search-providers', + component: () => import('@/pages/search-providers/index.vue'), + meta: { + breadcrumb: i18nRef('sidebar.searchProvider'), + }, + }, { name: 'settings', path: '/settings', diff --git a/spec/docs.go b/spec/docs.go index b9bf3bc5..17698791 100644 --- a/spec/docs.go +++ b/spec/docs.go @@ -4030,6 +4030,244 @@ const docTemplate = `{ } } }, + "/search-providers": { + "get": { + "description": "List configured search providers", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "search-providers" + ], + "summary": "List search providers", + "parameters": [ + { + "type": "string", + "description": "Provider filter (brave)", + "name": "provider", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/searchproviders.GetResponse" + } + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + } + } + }, + "post": { + "description": "Create a search provider configuration", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "search-providers" + ], + "summary": "Create a search provider", + "parameters": [ + { + "description": "Search provider configuration", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/searchproviders.CreateRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/searchproviders.GetResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + } + } + } + }, + "/search-providers/meta": { + "get": { + "description": "List available search provider types and config schemas", + "tags": [ + "search-providers" + ], + "summary": "List search provider metadata", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/searchproviders.ProviderMeta" + } + } + } + } + } + }, + "/search-providers/{id}": { + "get": { + "description": "Get search provider by ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "search-providers" + ], + "summary": "Get a search provider", + "parameters": [ + { + "type": "string", + "description": "Provider ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/searchproviders.GetResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + } + } + }, + "put": { + "description": "Update search provider by ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "search-providers" + ], + "summary": "Update a search provider", + "parameters": [ + { + "type": "string", + "description": "Provider ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Updated configuration", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/searchproviders.UpdateRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/searchproviders.GetResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + } + } + }, + "delete": { + "description": "Delete search provider by ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "search-providers" + ], + "summary": "Delete a search provider", + "parameters": [ + { + "type": "string", + "description": "Provider ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + } + } + } + }, "/users": { "get": { "description": "List users", @@ -6480,6 +6718,118 @@ const docTemplate = `{ } } }, + "searchproviders.CreateRequest": { + "type": "object", + "properties": { + "config": { + "type": "object", + "additionalProperties": {} + }, + "name": { + "type": "string" + }, + "provider": { + "$ref": "#/definitions/searchproviders.ProviderName" + } + } + }, + "searchproviders.GetResponse": { + "type": "object", + "properties": { + "config": { + "type": "object", + "additionalProperties": {} + }, + "created_at": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "searchproviders.ProviderConfigSchema": { + "type": "object", + "properties": { + "fields": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/searchproviders.ProviderFieldSchema" + } + } + } + }, + "searchproviders.ProviderFieldSchema": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "enum": { + "type": "array", + "items": { + "type": "string" + } + }, + "example": {}, + "required": { + "type": "boolean" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "searchproviders.ProviderMeta": { + "type": "object", + "properties": { + "config_schema": { + "$ref": "#/definitions/searchproviders.ProviderConfigSchema" + }, + "display_name": { + "type": "string" + }, + "provider": { + "type": "string" + } + } + }, + "searchproviders.ProviderName": { + "type": "string", + "enum": [ + "brave" + ], + "x-enum-varnames": [ + "ProviderBrave" + ] + }, + "searchproviders.UpdateRequest": { + "type": "object", + "properties": { + "config": { + "type": "object", + "additionalProperties": {} + }, + "name": { + "type": "string" + }, + "provider": { + "$ref": "#/definitions/searchproviders.ProviderName" + } + } + }, "settings.Settings": { "type": "object", "properties": { @@ -6500,6 +6850,9 @@ const docTemplate = `{ }, "memory_model_id": { "type": "string" + }, + "search_provider_id": { + "type": "string" } } }, @@ -6523,6 +6876,9 @@ const docTemplate = `{ }, "memory_model_id": { "type": "string" + }, + "search_provider_id": { + "type": "string" } } }, diff --git a/spec/swagger.json b/spec/swagger.json index 0be46d42..e9570cac 100644 --- a/spec/swagger.json +++ b/spec/swagger.json @@ -4021,6 +4021,244 @@ } } }, + "/search-providers": { + "get": { + "description": "List configured search providers", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "search-providers" + ], + "summary": "List search providers", + "parameters": [ + { + "type": "string", + "description": "Provider filter (brave)", + "name": "provider", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/searchproviders.GetResponse" + } + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + } + } + }, + "post": { + "description": "Create a search provider configuration", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "search-providers" + ], + "summary": "Create a search provider", + "parameters": [ + { + "description": "Search provider configuration", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/searchproviders.CreateRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/searchproviders.GetResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + } + } + } + }, + "/search-providers/meta": { + "get": { + "description": "List available search provider types and config schemas", + "tags": [ + "search-providers" + ], + "summary": "List search provider metadata", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/searchproviders.ProviderMeta" + } + } + } + } + } + }, + "/search-providers/{id}": { + "get": { + "description": "Get search provider by ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "search-providers" + ], + "summary": "Get a search provider", + "parameters": [ + { + "type": "string", + "description": "Provider ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/searchproviders.GetResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + } + } + }, + "put": { + "description": "Update search provider by ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "search-providers" + ], + "summary": "Update a search provider", + "parameters": [ + { + "type": "string", + "description": "Provider ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Updated configuration", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/searchproviders.UpdateRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/searchproviders.GetResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + } + } + }, + "delete": { + "description": "Delete search provider by ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "search-providers" + ], + "summary": "Delete a search provider", + "parameters": [ + { + "type": "string", + "description": "Provider ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/handlers.ErrorResponse" + } + } + } + } + }, "/users": { "get": { "description": "List users", @@ -6471,6 +6709,118 @@ } } }, + "searchproviders.CreateRequest": { + "type": "object", + "properties": { + "config": { + "type": "object", + "additionalProperties": {} + }, + "name": { + "type": "string" + }, + "provider": { + "$ref": "#/definitions/searchproviders.ProviderName" + } + } + }, + "searchproviders.GetResponse": { + "type": "object", + "properties": { + "config": { + "type": "object", + "additionalProperties": {} + }, + "created_at": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "searchproviders.ProviderConfigSchema": { + "type": "object", + "properties": { + "fields": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/searchproviders.ProviderFieldSchema" + } + } + } + }, + "searchproviders.ProviderFieldSchema": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "enum": { + "type": "array", + "items": { + "type": "string" + } + }, + "example": {}, + "required": { + "type": "boolean" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "searchproviders.ProviderMeta": { + "type": "object", + "properties": { + "config_schema": { + "$ref": "#/definitions/searchproviders.ProviderConfigSchema" + }, + "display_name": { + "type": "string" + }, + "provider": { + "type": "string" + } + } + }, + "searchproviders.ProviderName": { + "type": "string", + "enum": [ + "brave" + ], + "x-enum-varnames": [ + "ProviderBrave" + ] + }, + "searchproviders.UpdateRequest": { + "type": "object", + "properties": { + "config": { + "type": "object", + "additionalProperties": {} + }, + "name": { + "type": "string" + }, + "provider": { + "$ref": "#/definitions/searchproviders.ProviderName" + } + } + }, "settings.Settings": { "type": "object", "properties": { @@ -6491,6 +6841,9 @@ }, "memory_model_id": { "type": "string" + }, + "search_provider_id": { + "type": "string" } } }, @@ -6514,6 +6867,9 @@ }, "memory_model_id": { "type": "string" + }, + "search_provider_id": { + "type": "string" } } }, diff --git a/spec/swagger.yaml b/spec/swagger.yaml index 2227d738..8b24c220 100644 --- a/spec/swagger.yaml +++ b/spec/swagger.yaml @@ -1317,6 +1317,80 @@ definitions: pattern: type: string type: object + searchproviders.CreateRequest: + properties: + config: + additionalProperties: {} + type: object + name: + type: string + provider: + $ref: '#/definitions/searchproviders.ProviderName' + type: object + searchproviders.GetResponse: + properties: + config: + additionalProperties: {} + type: object + created_at: + type: string + id: + type: string + name: + type: string + provider: + type: string + updated_at: + type: string + type: object + searchproviders.ProviderConfigSchema: + properties: + fields: + additionalProperties: + $ref: '#/definitions/searchproviders.ProviderFieldSchema' + type: object + type: object + searchproviders.ProviderFieldSchema: + properties: + description: + type: string + enum: + items: + type: string + type: array + example: {} + required: + type: boolean + title: + type: string + type: + type: string + type: object + searchproviders.ProviderMeta: + properties: + config_schema: + $ref: '#/definitions/searchproviders.ProviderConfigSchema' + display_name: + type: string + provider: + type: string + type: object + searchproviders.ProviderName: + enum: + - brave + type: string + x-enum-varnames: + - ProviderBrave + searchproviders.UpdateRequest: + properties: + config: + additionalProperties: {} + type: object + name: + type: string + provider: + $ref: '#/definitions/searchproviders.ProviderName' + type: object settings.Settings: properties: allow_guest: @@ -1331,6 +1405,8 @@ definitions: type: integer memory_model_id: type: string + search_provider_id: + type: string type: object settings.UpsertRequest: properties: @@ -1346,6 +1422,8 @@ definitions: type: integer memory_model_id: type: string + search_provider_id: + type: string type: object subagent.AddSkillsRequest: properties: @@ -4130,6 +4208,163 @@ paths: summary: Get provider by name tags: - providers + /search-providers: + get: + consumes: + - application/json + description: List configured search providers + parameters: + - description: Provider filter (brave) + in: query + name: provider + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/searchproviders.GetResponse' + type: array + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/handlers.ErrorResponse' + summary: List search providers + tags: + - search-providers + post: + consumes: + - application/json + description: Create a search provider configuration + parameters: + - description: Search provider configuration + in: body + name: request + required: true + schema: + $ref: '#/definitions/searchproviders.CreateRequest' + produces: + - application/json + responses: + "201": + description: Created + schema: + $ref: '#/definitions/searchproviders.GetResponse' + "400": + description: Bad Request + schema: + $ref: '#/definitions/handlers.ErrorResponse' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/handlers.ErrorResponse' + summary: Create a search provider + tags: + - search-providers + /search-providers/{id}: + delete: + consumes: + - application/json + description: Delete search provider by ID + parameters: + - description: Provider ID + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "204": + description: No Content + "400": + description: Bad Request + schema: + $ref: '#/definitions/handlers.ErrorResponse' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/handlers.ErrorResponse' + summary: Delete a search provider + tags: + - search-providers + get: + consumes: + - application/json + description: Get search provider by ID + parameters: + - description: Provider ID + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/searchproviders.GetResponse' + "400": + description: Bad Request + schema: + $ref: '#/definitions/handlers.ErrorResponse' + "404": + description: Not Found + schema: + $ref: '#/definitions/handlers.ErrorResponse' + summary: Get a search provider + tags: + - search-providers + put: + consumes: + - application/json + description: Update search provider by ID + parameters: + - description: Provider ID + in: path + name: id + required: true + type: string + - description: Updated configuration + in: body + name: request + required: true + schema: + $ref: '#/definitions/searchproviders.UpdateRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/searchproviders.GetResponse' + "400": + description: Bad Request + schema: + $ref: '#/definitions/handlers.ErrorResponse' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/handlers.ErrorResponse' + summary: Update a search provider + tags: + - search-providers + /search-providers/meta: + get: + description: List available search provider types and config schemas + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/searchproviders.ProviderMeta' + type: array + summary: List search provider metadata + tags: + - search-providers /users: get: description: List users