Skip to content

Conversation

@wukaixingxp
Copy link
Contributor

What does this PR do?

Running into this error:

python test_vision.py
Traceback (most recent call last):
  File "/Users/kaiwu/work/internal-llama-stack-apps/examples/computer_use/test_vision.py", line 5, in <module>
    from llama_stack_client.lib.agents.react.agent import ReActAgent
  File "/opt/homebrew/anaconda3/envs/dmg/lib/python3.10/site-packages/llama_stack_client/lib/agents/react/agent.py", line 20, in <module>
    from .tool_parser import ReActOutput, ReActToolParser
  File "/opt/homebrew/anaconda3/envs/dmg/lib/python3.10/site-packages/llama_stack_client/lib/agents/react/tool_parser.py", line 35, in <module>
    class ReActToolParser(ToolParser):
  File "/opt/homebrew/anaconda3/envs/dmg/lib/python3.10/site-packages/llama_stack_client/lib/agents/react/tool_parser.py", line 36, in ReActToolParser
    @override
NameError: name 'override' is not defined

Removing this line fixed this error.
Now I can run react agent:

python test_vision.py
ChatCompletionResponse(
│   completion_message=CompletionMessage(
│   │   content="The image features a close-up of a Golden Retriever puppy, with the dog's head and upper body prominently displayed. The puppy is centered in the frame, facing forward, and its mouth is open, revealing its tongue. The background of the image is blurred, but it appears to be a natural setting, possibly outdoors or in a park.\n\n**Key Features:**\n\n* **Dog Breed:** The dog in the image is a Golden Retriever puppy.\n* **Facial Expression:** The puppy's mouth is open, showing its tongue.\n* **Background:** The background is blurred, suggesting a natural setting.\n* **Overall Impression:** The image conveys a sense of joy and playfulness, capturing the energetic and friendly nature of the Golden Retriever breed.",
│   │   role='assistant',
│   │   stop_reason='end_of_turn',
│   │   tool_calls=[]
│   ),
│   logprobs=None,
│   metrics=[
│   │   Metric(metric='prompt_tokens', value=22.0, unit=None),
│   │   Metric(metric='completion_tokens', value=166.0, unit=None),
│   │   Metric(metric='total_tokens', value=188.0, unit=None)
│   ]
)

Test Plan

[Describe the tests you ran to verify your changes with result summaries. Provide clear instructions so the plan can be easily re-executed.]

Copy link
Member

@raghotham raghotham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this instead of removing?

from typing import override

@wukaixingxp
Copy link
Contributor Author

@raghotham @hardikjshah I am using python3.10 and got this error

Traceback (most recent call last):
  File "/Users/kaiwu/work/internal-llama-stack-apps/examples/computer_use/test_vision.py", line 5, in <module>
    from llama_stack_client.lib.agents.react.agent import ReActAgent
  File "/Users/kaiwu/work/to_merge/llama-stack-client-python/src/llama_stack_client/lib/agents/react/agent.py", line 20, in <module>
    from .tool_parser import ReActOutput, ReActToolParser
  File "/Users/kaiwu/work/to_merge/llama-stack-client-python/src/llama_stack_client/lib/agents/react/tool_parser.py", line 9, in <module>
    from typing import List, Optional, Union, override
ImportError: cannot import name 'override' from 'typing' (/opt/homebrew/anaconda3/envs/dmg/lib/python3.10/typing.py) 

It seems that typing.override added in python 3.12, we have to remove it to support 3.10 or do we want to set minimal python version to 3.12 instead?

@raghotham raghotham merged commit 6155c31 into llamastack:main Mar 24, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants