-
Notifications
You must be signed in to change notification settings - Fork 43
Add basic Effect example extracted from wrapper repo #49
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 introductory example for using OpenRouter with @effect/ai and @effect/ai-openrouter, demonstrating fundamental Effect-TS patterns for AI interactions. The example was extracted from a wrapper repository and has been formatted according to the project's code style.
- Adds a new
src/basic/example.tsfile demonstrating Effect-TS patterns - Includes three examples: simple text generation, stateful chat conversations, and streaming responses
- Follows existing code patterns with layer-based dependency injection and Effect.gen composition
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /** | ||
| * Example: Using OpenRouter with @effect/ai and @effect/ai-openrouter | ||
| * | ||
| * This example demonstrates idiomatic Effect patterns for AI interactions: | ||
| * - Effect.gen for generator-style effect composition | ||
| * - Layer-based dependency injection | ||
| * - Type-safe error handling with Effect | ||
| * - Streaming responses with Effect streams | ||
| */ |
Copilot
AI
Nov 12, 2025
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 new basic example is not included in the package.json scripts. The current examples script only runs the prompt-caching examples. Consider updating the package.json to include this new basic example:
"scripts": {
"examples": "bun run src/basic/example.ts && bun run src/prompt-caching/...",
"typecheck": "tsc --noEmit"
}Alternatively, if this is intentional, consider documenting how to run this example in the README or in a comment at the top of the file.
189d80e to
9795a98
Compare
a828c0d to
27587c3
Compare
27587c3 to
eec029a
Compare
9795a98 to
9c1f09c
Compare
louisgv
left a comment
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.
nit: this one has more comment about effect than about OpenRouter

Add basic Effect example extracted from wrapper repo
Run biome format and fix import sorting