Files
wehub-resource-sync d25d482dc2
Publish CLI Package / publish-npm (push) Waiting to run
Publish Python SDK / publish-pypi (push) Waiting to run
Publish TypeScript SDK / publish-npm (push) Waiting to run
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:20:55 +08:00

87 lines
2.5 KiB
TypeScript

import type { ToolConfig } from '@/tools/types'
import type { ZepResponse } from '@/tools/zep/types'
import { PAGINATION_OUTPUT_PROPERTIES, THREADS_ARRAY_OUTPUT } from '@/tools/zep/types'
export const zepGetThreadsTool: ToolConfig<any, ZepResponse> = {
id: 'zep_get_threads',
name: 'Get Threads',
description: 'List all conversation threads',
version: '1.0.0',
params: {
pageSize: {
type: 'number',
required: false,
default: 10,
visibility: 'user-or-llm',
description: 'Number of threads to retrieve per page (e.g., 10, 25, 50)',
},
pageNumber: {
type: 'number',
required: false,
default: 1,
visibility: 'user-or-llm',
description: 'Page number for pagination (e.g., 1, 2, 3)',
},
orderBy: {
type: 'string',
required: false,
visibility: 'user-only',
description: 'Field to order results by (created_at, updated_at, user_id, thread_id)',
},
asc: {
type: 'boolean',
required: false,
default: false,
visibility: 'user-only',
description: 'Order direction: true for ascending, false for descending',
},
apiKey: {
type: 'string',
required: true,
visibility: 'user-only',
description: 'Your Zep API key',
},
},
request: {
url: (params) => {
const queryParams = new URLSearchParams()
queryParams.append('page_size', String(Number(params.pageSize || 10)))
queryParams.append('page_number', String(Number(params.pageNumber || 1)))
if (params.orderBy) queryParams.append('order_by', params.orderBy)
if (params.asc !== undefined) queryParams.append('asc', String(params.asc))
return `https://api.getzep.com/api/v2/threads?${queryParams.toString()}`
},
method: 'GET',
headers: (params) => ({
Authorization: `Api-Key ${params.apiKey}`,
'Content-Type': 'application/json',
}),
},
transformResponse: async (response) => {
if (!response.ok) {
const error = await response.text()
throw new Error(`Zep API error (${response.status}): ${error || response.statusText}`)
}
const data = await response.json()
return {
success: true,
output: {
threads: data.threads || [],
responseCount: data.response_count,
totalCount: data.total_count,
},
}
},
outputs: {
threads: THREADS_ARRAY_OUTPUT,
responseCount: PAGINATION_OUTPUT_PROPERTIES.responseCount,
totalCount: PAGINATION_OUTPUT_PROPERTIES.totalCount,
},
}