-
Notifications
You must be signed in to change notification settings - Fork 8
Added LLM context #73
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
Added LLM context #73
Conversation
|
Validation that failed is unrelated to my changes AFAIK. |
|
@RomKadria I moved the rules to the root of the repo. Can you approve this? ⭐ |
| data: { | ||
| loading: boolean; // Query-specific loading state | ||
| error: APIError | null; // Query-specific errors | ||
| data: T; // Your query results |
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.
why do we need it? the type are auto generated here
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.
From my testing, seems like Cursor only looks at the types exposed by a library when fixing bugs (rather than generating code). Explicitly declaring the shape should make it more reliable.
The main thing I wanted to document is that the return object has nesting – which is hard to infer from the package source because it uses a generic return type T.
| // Structured error type | ||
| type APIError = { | ||
| message: string; | ||
| status: number; |
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.
we are already exporting the error ourselves as well
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.
See previous comment. I'm willing to remove this but in my testing it resulted in worse code (Cursor would try to access the data in the API error wrong or hallucinate the return value)
|
@RomKadria Implemented all your feedback except the types one. Can we merge on Sunday/Monday? |
Added sample context for developers writing code with LLM assistance. It makes it more likely for AI tools like Copilot or Cursor to write correct code for our SDKs and API.
@RomKadria Can you review these changes? This is my first time contributing to the API project. Happy to hear any feedback.
Description of changes -
packages/llm-contextfolder