-
Notifications
You must be signed in to change notification settings - Fork 888
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
fix: resolve type hint issues and import dependencies #1176
Conversation
|
from typing import List | ||
from typing import TYPE_CHECKING, List | ||
|
||
if TYPE_CHECKING: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeehaaaw!
@@ -19,6 +19,8 @@ | |||
# Import necessary components from Matplotlib | |||
from matplotlib.backends.backend_agg import FigureCanvasAgg | |||
|
|||
from llama_stack.providers.inline.tool_runtime.code_interpreter.code_env_prefix import _open_connections |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is actually not correct. the _open_connections
method is dynamically made available to the interpreter by bundling code from "code_env_prefix.py" -- by literally prefixing it -- and then "eval"ing it within a sandboxed interpreter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -231,7 +231,7 @@ def worker_process_entrypoint( | |||
while True: | |||
try: | |||
task = req_gen.send(result) | |||
if isinstance(task, str) and task == _END_SENTINEL: | |||
if isinstance(task, str) and task == EndSentinel(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait what? this was just referencing some unknown symbol?! 🤦
- Fixed type hinting and missing imports across multiple modules. - Improved compatibility by using `TYPE_CHECKING` for conditional imports. - Updated `pyproject.toml` to enforce stricter linting. Signed-off-by: Sébastien Han <[email protected]>
What does this PR do?
TYPE_CHECKING
for conditional imports.pyproject.toml
to enforce stricter linting.Signed-off-by: Sébastien Han [email protected]