Updated base route of docs

This commit is contained in:
Amith Koujalgi 2024-02-22 11:50:41 +05:30
parent a10692e2f1
commit 9224d2da06
2 changed files with 10 additions and 7 deletions

View File

@ -11,7 +11,7 @@ the [completion](https://github.com/jmorganca/ollama/blob/main/docs/api.md#gener
Use the `OptionBuilder` to build the `Options` object Use the `OptionBuilder` to build the `Options` object
with [extra parameters](https://github.com/jmorganca/ollama/blob/main/docs/modelfile.md#valid-parameters-and-values). with [extra parameters](https://github.com/jmorganca/ollama/blob/main/docs/modelfile.md#valid-parameters-and-values).
Refer Refer
to [this](/docs/apis-extras/options-builder). to [this](/apis-extras/options-builder).
## Try asking a question about the model. ## Try asking a question about the model.
@ -53,25 +53,26 @@ public class Main {
OllamaAPI ollamaAPI = new OllamaAPI(host); OllamaAPI ollamaAPI = new OllamaAPI(host);
// define a stream handler (Consumer<String>) // define a stream handler (Consumer<String>)
OllamaStreamHandler streamHandler = (s) -> { OllamaStreamHandler streamHandler = (s) -> {
System.out.println(s); System.out.println(s);
}; };
// Should be called using seperate thread to gain non blocking streaming effect. // Should be called using seperate thread to gain non blocking streaming effect.
OllamaResult result = ollamaAPI.generate(config.getModel(), OllamaResult result = ollamaAPI.generate(config.getModel(),
"What is the capital of France? And what's France's connection with Mona Lisa?", "What is the capital of France? And what's France's connection with Mona Lisa?",
new OptionsBuilder().build(), streamHandler); new OptionsBuilder().build(), streamHandler);
System.out.println("Full response: " +result.getResponse()); System.out.println("Full response: " + result.getResponse());
} }
} }
``` ```
You will get a response similar to: You will get a response similar to:
> The > The
> The capital > The capital
> The capital of > The capital of
> The capital of France > The capital of France
> The capital of France is > The capital of France is
> The capital of France is Paris > The capital of France is Paris
> The capital of France is Paris. > The capital of France is Paris.
> Full response: The capital of France is Paris. > Full response: The capital of France is Paris.

View File

@ -40,6 +40,8 @@ const config = {
/** @type {import('@docusaurus/preset-classic').Options} */ /** @type {import('@docusaurus/preset-classic').Options} */
({ ({
docs: { docs: {
path: 'docs',
routeBasePath: '', // change this to any URL route you'd want. For example: `home` - if you want /home/intro.
sidebarPath: './sidebars.js', sidebarPath: './sidebars.js',
// Please change this to your repo. // Please change this to your repo.
// Remove this to remove the "edit this page" links. // Remove this to remove the "edit this page" links.