Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

next
ts 15 lines 710 Bytes
Raw
1 import { describe, expect, test } from 'bun:test';
2 import { searchDocs } from '../../agent/lib/docs-search';
3 import { readPageByUrl } from '../../agent/lib/docs';
4
5 describe('docs agent knowledge base retrieval', () => {
6 test('search_docs returns KB guides and read_doc can open them', () => {
7 const { results } = searchDocs('organization API rate limits 429', { limit: 8 });
8 const guide = results.find(result => result.url === '/kb/guide/platform-rate-limits');
9
10 expect(guide).toBeDefined();
11 expect(guide?.content).toContain('429');
12 expect(readPageByUrl('/kb/guide/platform-rate-limits')?.title).toBe('Platform API Rate Limits');
13 expect(readPageByUrl('/kb')).toBeDefined();
14 });
15 });