MCPcopy Create free account
hub / github.com/pollinations/pollinations / testFunctionCalling

Function testFunctionCalling

apps/chat/test-function-calling.js:4–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2
3// Test function calling
4const testFunctionCalling = async () => {
5 const messages = [
6 { role: 'user', content: 'Create a bar chart showing sales data for January, February, and March with values 100, 150, 200' }
7 ];
8
9 console.log('Testing function calling...');
10
11 await sendMessage(
12 messages,
13 (chunk, fullContent, error) => {
14 console.log('Chunk received:', chunk);
15 },
16 (finalContent, error) => {
17 console.log('Final content:', finalContent);
18 console.log('Error:', error);
19 },
20 (error) => {
21 console.error('Error:', error);
22 },
23 'openai-large',
24 { maxTokens: 1000, temperature: 0.7 }
25 );
26};
27
28testFunctionCalling();

Callers 1

Calls 3

sendMessageFunction · 0.90
logMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected