marvin icon indicating copy to clipboard operation
marvin copied to clipboard

@ai_flow breaks because of incorrect import of interactive_chat

Open max-clouatre opened this issue 1 year ago • 0 comments

First check

  • [X] I added a descriptive title to this issue.
  • [X] I used the GitHub search to try to find a similar issue and didn't find one.
  • [X] I searched the Marvin documentation for this issue.

Bug summary

Looks like ai_flow has an old import for chat_ui.interactive_chat image

If I update the import path, ai_flow works as expected

from marvin.beta.chat_ui import interactive_chat

There is no documentation for this work aside from an old tweet from @jlowin so no pressure, just noting!

Reproduction

from marvin.beta.ai_flow import ai_flow, ai_task

@ai_task
def get_first_name():
    """ Get the users first name"""

@ai_task
def write_poem(name:str):
    """ Write a short poem for the user"""

@ai_flow
def hello_world():
    name = get_first_name()
    write_poem(name)

if __name__ == "__main__":
    hello_world()

Error

Traceback (most recent call last):
  File "C:\src\MLab-AI-Extraction-Api\test.py", line 46, in <module>
    from marvin.beta.ai_flow import ai_flow, ai_task
  File "C:\src\MLab-AI-Extraction-Api\.venv\Lib\site-packages\marvin\beta\ai_flow\__init__.py", line 2, in <module>
    from .ai_flow import ai_flow
  File "C:\src\MLab-AI-Extraction-Api\.venv\Lib\site-packages\marvin\beta\ai_flow\ai_flow.py", line 10, in <module>
    from .chat_ui import interactive_chat
ModuleNotFoundError: No module named 'marvin.beta.ai_flow.chat_ui'

Versions

Version:                2.1.5
Python version:         3.11.2       
OS/Arch:                windows/amd64

Additional context

No response

max-clouatre avatar Feb 22 '24 19:02 max-clouatre