Code Monkey home page Code Monkey logo

Comments (7)

D-W- avatar D-W- commented on July 20, 2024 1

Added a long-term tag for this. I have a proposal to introduce a code field to flow's YAML. If user need to import outside of current working directory. They can set flow's code to base folder.

For example, a project organized like this

src/
    common/
    flow1/
    flow2/

The flow1 and flow2 can set code in flow YAML like this

code: path/to/src

But, you'll need to use absolute import like this

from common import xxx

instead of relative import like this

from .. import xxx

since we used multi-processing to execute flow and relative import may fail to find it's parent package.

from promptflow.

D-W- avatar D-W- commented on July 20, 2024

Hi @pamelafox , in our concept, flow should be self-contained. Which makes it easier to build flow snapshot and share from local to cloud. When flow has relative external imports, we could not build snapshot for it. But we can improve the error message to make it more friendly to customer.

from promptflow.

github-actions avatar github-actions commented on July 20, 2024

Hi, we're sending this friendly reminder because we haven't heard back from you in 30 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 7 days of this comment, the issue will be automatically closed. Thank you!

from promptflow.

pamelafox avatar pamelafox commented on July 20, 2024

I think promptflow should be able to work with files that import other files, as most developers use modules in order to improve code reusability. If I can't bring in any other files, then I will have to needlessly repeat common code across parts of my codebase.

from promptflow.

mces89 avatar mces89 commented on July 20, 2024

blocked on the same issue.

from promptflow.

MingStar avatar MingStar commented on July 20, 2024

I'm blocked on this issue as well with 2 flows in the same project, both flows required shared code logic, and the VS Code extension were not able to import shared modules as Python nodes/tools.

Restructuring the project only works when just one flow at the root level.

from promptflow.

D-W- avatar D-W- commented on July 20, 2024

@MingStar , since it's currently prompt flow's by design behavior. A workaround would be put both of the flow files in root level like this. Let me know if it helps.

lib/
flow1/
flow2/
flow1.dag.yaml
flow2.dag.yaml

from promptflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.