UNPKG

@lobehub/chat

Version:

Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.

40 lines (30 loc) 862 B
import { Tool } from '@/prompts/plugin/tools'; import { pluginPrompts } from './index'; describe('pluginPrompts', () => { it('should generate plugin prompts with tools', () => { const tools: Tool[] = [ { name: 'tool1', identifier: 'id1', apis: [ { name: 'api1', desc: 'API 1', }, ], }, ]; const expected = `<plugins description="The plugins you can use below"> <collection name="tool1"> <api identifier="api1">API 1</api> </collection> </plugins>`; expect(pluginPrompts({ tools })).toBe(expected); }); it('should generate plugin prompts without tools', () => { const tools: Tool[] = []; const expected = `<plugins description="The plugins you can use below"> </plugins>`; expect(pluginPrompts({ tools })).toBe(expected); }); });