mirror of
https://github.com/ggozad/oterm.git
synced 2026-11-02 19:31:25 +01:00
20 lines
515 B
Python
20 lines
515 B
Python
import pytest
|
|
|
|
from oterm.ollamaclient import OllamaLLM
|
|
from oterm.tools.shell import ShellTool, shell_command
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_shell(default_model):
|
|
llm = OllamaLLM(
|
|
model=default_model,
|
|
tool_defs=[
|
|
{"tool": ShellTool, "callable": shell_command},
|
|
],
|
|
)
|
|
res = ""
|
|
async for _, text in llm.stream(
|
|
"What is the current directory? Use the shell tool available and execute the command."
|
|
):
|
|
res = text
|
|
assert "oterm" in res
|