Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ollama Tool Streaming #1486

Open
1 task done
collindutter opened this issue Dec 24, 2024 · 1 comment
Open
1 task done

Ollama Tool Streaming #1486

collindutter opened this issue Dec 24, 2024 · 1 comment
Assignees
Labels
type:enhancement Improvements to existing features
Milestone

Comments

@collindutter
Copy link
Member

Is your feature request related to a problem? Please describe.
OllamaPromptDriver does not support tool use with streaming. It should now that Ollama supports it.

@collindutter collindutter added the type:enhancement Improvements to existing features label Dec 24, 2024
@collindutter collindutter added this to the 2.0 milestone Dec 24, 2024
@collindutter collindutter self-assigned this Dec 24, 2024
@collindutter collindutter modified the milestones: 2.0, 1.1 Dec 24, 2024
@collindutter
Copy link
Member Author

Interestingly, this is still not working for me:

from griptape.drivers import OllamaPromptDriver
from griptape.structures import Agent
from griptape.tools import CalculatorTool

agent = Agent(
    stream=True,
    prompt_driver=OllamaPromptDriver(model="llama3.2"),
    tools=[CalculatorTool()],
)
agent.run("What is (192 + 12) ^ 4")
[12/26/24 12:21:17] INFO     PromptTask ab7c81c6f16045fb9c393d96b9ab8d06
                             Input: What is (192 + 12) ^ 4
[12/26/24 12:21:19] INFO     PromptTask ab7c81c6f16045fb9c393d96b9ab8d06
                             Output: To calculate this, I'll follow the order
                             of operations (PEMDAS):

                             1. Calculate the expression inside the
                             parentheses: 192 + 12 = 204
                             2. Raise 204 to the power of 4: 204 ^ 4 =
                             6,597,504

vs

from griptape.drivers import OllamaPromptDriver
from griptape.structures import Agent
from griptape.tools import CalculatorTool

agent = Agent(
    prompt_driver=OllamaPromptDriver(model="llama3.2"),
    tools=[CalculatorTool()],
)
agent.run("What is (192 + 12) ^ 4")
[12/26/24 12:21:41] INFO     PromptTask dd3c4e7daeb2429aace351cc83edf6ee
                             Input: What is (192 + 12) ^ 4
[12/26/24 12:21:43] INFO     Subtask 1bb9e35de7334855b2776acbcbb097eb
                             Actions: [
                               {
                                 "tag": "CalculatorTool_calculate",
                                 "name": "CalculatorTool",
                                 "path": "calculate",
                                 "input": {
                                   "values": {
                                     "expression": "(192 + 12)^4"
                                   }
                                 }
                               }
                             ]
                    INFO     Subtask 1bb9e35de7334855b2776acbcbb097eb
                             Response: 200
[12/26/24 12:21:44] INFO     PromptTask dd3c4e7daeb2429aace351cc83edf6ee
                             Output: The result of the expression `(192 +
                             12)^4` is `200`.

@collindutter collindutter modified the milestones: 1.1, 2.0 Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Improvements to existing features
Projects
None yet
Development

No branches or pull requests

1 participant