-
Notifications
You must be signed in to change notification settings - Fork 9
new builtin: generateObject #1143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mrge found 22 issues across 15 files. Review them in mrge.io
packages/builder/src/built-in.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using 'any' as default type parameter reduces type safety. Consider using a more specific default type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function returns { object, spanId } but doesn't include the 'id' field required by LLMGenerateObjectResponse
packages/llm/src/client.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method returns only the 'object' property from the response but the return type includes an 'id' field which is not being returned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The imported generateObject function references an undefined variable 'prompt' in the llm.ts file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using z.any() in schema validation reduces type safety and can lead to unexpected runtime errors
recipes/counter.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No error handling for LLM call failures
recipes/counter.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON.stringify used directly for UI display without proper formatting
recipes/counter.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter name shadows type name causing potential confusion
recipes/counter.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused imported 'ifElse' function
recipes/numberJson.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use commontools for all of these imports including h
recipes/numberJson.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CompilerError: [ERROR] Module '"commontools"' has no exported member 'generateObject'. [/numbersjson.tsx:4:3]
generateObject definition (~virtual, see other builtins) must be added to @commontools/api, and its types generated via cd packages/static && deno task compile-api-types
deno.lock
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these changes to the lock intentional?
|
@jsantell thx for review - I'm updating it now to work with all the changes! |
cfc6fa4 to
6a13678
Compare
Summary by mrge
Added a new generateObject LLM API and builder node for generating structured JSON objects from prompts and schemas, with backend validation and example usage in recipes.
New Features
Dependencies