We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7aa898f commit 6ccfdfdCopy full SHA for 6ccfdfd
2 files changed
packages/openapi/src/formula/ai.ts
@@ -1,11 +1,21 @@
1
import { funcDefine } from './func-define';
2
3
-export const getFormulaPrompt = (prompt: string, fields: { name: string }[]) => {
+export const getFormulaPrompt = (
4
+ prompt: string,
5
+ fields: { name: string }[],
6
+ includeReturnTypes?: boolean
7
+) => {
8
const context = fields.map((field) => field.name).join('\n');
9
10
// Convert function definitions to a readable format
11
const functionDocs = funcDefine
12
.map(([_name, schema]) => {
13
+ if (includeReturnTypes) {
14
+ return `
15
+ - Definition:${schema.definition}
16
+ - ReturnsType: ${schema.returnType}
17
+ `;
18
+ }
19
return schema.definition;
20
})
21
.join('\n');
0 commit comments