-
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
6 changed files
with
43 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
version = "0.0.0" | ||
author = "Your name" | ||
description = "Description of your library" | ||
version = "0.0.1" | ||
author = "Andrew Brower" | ||
description = "Ollama API for Nim" | ||
license = "MIT" | ||
|
||
srcDir = "src" | ||
|
||
requires "nim >= 1.2.2" | ||
requires "nim >= 2.0.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import curly | ||
|
||
## ollama API Interface | ||
## https://github.com/jmorganca/ollama/blob/main/docs/api.md | ||
|
||
type | ||
OllamaAPI* = ref object | ||
curlPool: CurlPool | ||
url: string | ||
curlTimeout: float32 | ||
|
||
proc newOllamaAPI*( | ||
url: string = "http://localhost:11434/api", | ||
curlPoolSize: int = 4, | ||
curlTimeout: float32 = 10000 | ||
): OllamaAPI = | ||
result = OllamaAPI() | ||
result.curlPool = newCurlPool(curlPoolSize) | ||
result.url = url | ||
result.curlTimeout = curlTimeout | ||
|
||
proc close*(api: OllamaAPI) = | ||
api.curlPool.close() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,16 @@ | ||
## llama_leap API tests | ||
## Ensure that ollama is running! | ||
|
||
import llama_leap, unittest | ||
|
||
|
||
suite "llama_leap": | ||
var ollama: OllamaAPI | ||
|
||
setup: | ||
ollama = newOllamaApi() | ||
teardown: | ||
ollama.close() | ||
|
||
test "TODO": | ||
echo "TODO" |