-
Notifications
You must be signed in to change notification settings - Fork 43
Add basic fetch example extracted from wrapper repo #47
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
base: pdf-example-effect
Are you sure you want to change the base?
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.
Pull Request Overview
This PR adds a basic fetch API example demonstrating how to make direct HTTP requests to OpenRouter's API using native fetch without additional libraries. This provides a simpler, more accessible starting point for developers compared to the existing prompt-caching examples.
Key Changes:
- Adds a standalone fetch example with OpenAI-compatible chat completions
- Includes comprehensive inline documentation and error handling
- Uses TypeScript for type safety with local type definitions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bf84ccc to
afadffc
Compare
| console.log('Message:', requestBody.messages[0]?.content); | ||
| console.log(); | ||
|
|
||
| try { |
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.
top-level fetch?

Add basic fetch example extracted from wrapper repo
Run biome format