MCPcopy Index your code
hub / github.com/Xyntopia/taskyon / isOpenAIFunctionCall

Function isOpenAIFunctionCall

src/modules/taskWorker.ts:25–33  ·  view source on GitHub ↗
(
  choice: OpenAI.ChatCompletion['choices'][0]
)

Source from the content-addressed store, hash-verified

23import { load } from 'js-yaml';
24
25function isOpenAIFunctionCall(
26 choice: OpenAI.ChatCompletion['choices'][0]
27): boolean {
28 return (
29 (choice.finish_reason === 'function_call' ||
30 choice.finish_reason === 'tool_calls') &&
31 !!choice.message.tool_calls?.length
32 );
33}
34
35function extractOpenAIFunctions(choice: OpenAI.ChatCompletion['choices'][0]) {
36 const functionCalls: FunctionCall[] = [];

Callers 1

processChatTaskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected