-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Getting Started | ||
|
||
This guide explains how to get started with the `async-ollama` gem. | ||
|
||
## Installation | ||
|
||
Add the gem to your project: | ||
|
||
~~~ bash | ||
$ bundle add async-ollama | ||
~~~ | ||
|
||
## Core Concepts | ||
|
||
- The {ruby Async::Ollama::Client} is used for interacting with the Ollama server. | ||
- {ruby Async::Ollama::Generate} represents a single conversation response (with context) from the Ollama server. | ||
|
||
## Example | ||
|
||
~~~ ruby | ||
require 'async/ollama' | ||
|
||
Async::Ollama::Client.open do |client| | ||
generator = client.generate("Can you please tell me the first 10 digits of PI?") | ||
puts generator.response | ||
# Of course! The first 10 digits of pi are: | ||
# | ||
# 3.141592653 | ||
end | ||
~~~ | ||
|
||
### Using a Specific Model | ||
|
||
You can specify a model to use for generating responses: | ||
|
||
~~~ ruby | ||
require 'async/ollama' | ||
|
||
Async::Ollama::Client.open do |client| | ||
generator = client.generate("Can you please tell me the first 10 digits of PI?", model: "llama3") | ||
puts generator.response | ||
# The first 10 digits of Pi (π) are: | ||
# | ||
# 3.141592653 | ||
# | ||
# Let me know if you'd like more! | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
getting-started: | ||
order: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters