Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions docs/_reference/ecosystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ After reading this guide, you will know:
* How `RubyLLM::Monitoring` provides dashboards and alerts for RubyLLM activity
* How `RubyLLM::RedCandle` enables local model execution from Ruby
* How OpenTelemetry instrumentation for RubyLLM provides observability into your LLM applications
* How to test application code by stubbing responses with `RubyLLM::Test`
* Where to find community projects and how to contribute your own

## RubyLLM::Schema
Expand Down Expand Up @@ -282,6 +283,48 @@ For detailed documentation and examples, visit the [RubyLLM::Tribunal repository

---

## RubyLLM::Test

**Test Application Code by Stubbing LLM Responses**

[`RubyLLM::Test`](https://github.com/RockSolt/ruby_llm-test) allows you to stub LLM responses in your tests, making it easier to test application logic without relying on calls to external systems.

### Why Use RubyLLM::Test?

When writing tests for code that interacts with LLMs, you may want to:

- Ensure your application logic behaves correctly without making real API calls
- Test edge cases and error handling
- Control the responses from the LLM for deterministic tests

### Key Features

- Clear syntax for defining stubs and expected responses
- Support for multiple stubs in a single test
- Validate arguments, such as model or tool calls, passed to the LLM
- Works with RSpec and Minitest

### Usage

```ruby
RubyLLM::Test.stub_response("Outlook good")

chat = RubyLLM.chat
response = chat.ask "What are the odds this works?"

assert_equal "Outlook good", response.content
```

### Installation

Add the gem to the test group in your Gemfile, or install it directly:

```bash
gem install ruby_llm-test
```

---

## Community Projects

The RubyLLM ecosystem is growing! If you've built a library or tool that extends RubyLLM, we'd love to hear about it. Consider:
Expand Down