-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added Ollama engine via OpenAI api (#51)
* feat: Added Ollama engine via OpenAI api * fix: Added PR remarks and test
- Loading branch information
1 parent
a15e7b6
commit c94a6a7
Showing
4 changed files
with
61 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import pytest | ||
|
||
from textgrad.engine import get_engine | ||
|
||
def test_ollama_engine(): | ||
# Declare test constants | ||
OLLAMA_BASE_URL = 'http://localhost:11434/v1' | ||
MODEL_STRING = "test-model-string" | ||
|
||
# Initialise the engine | ||
engine = get_engine("ollama-" + MODEL_STRING) | ||
|
||
assert engine | ||
assert engine.model_string == MODEL_STRING | ||
assert engine.base_url == OLLAMA_BASE_URL |
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