Coder Social home page Coder Social logo

Comments (4)

d-shree avatar d-shree commented on August 18, 2024 1

This worked, but its strange that this error did not show up while testing normally, which was why I was having a hard time figuring out the exact cause of this issue.

from nemo-guardrails.

drazvan avatar drazvan commented on August 18, 2024

@d-shree : can you provide more details?

  • How are the guardrails initialized (the LLMRails instance)?
  • I'm assuming you're not using the built-in server
  • Can you share the Dockerfile? Because the action is not registered correctly, maybe there's an issue with the path that is used for the config.

from nemo-guardrails.

d-shree avatar d-shree commented on August 18, 2024

@drazvan

  1. The guardrails are initialised as follows -
client = ChatOpenAI(
      api_key=OPEN_AI_KEY,
  )
config = RailsConfig.from_content(
    colang_content=colang_flow,
    yaml_content=config_content
)

rails = LLMRails(config=config, llm=client)
  1. Nope, not using built-in server
  2. The Dockerfile is pretty straightforward as shown below, the colang flows are being passed via the request payload and actions are configured in a file called actions.py, using the @action decorator.
FROM python:3.9

WORKDIR /app

COPY requirements.txt .

RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE 8009

CMD ["uvicorn", "src.endpoints:app", "--host", "0.0.0.0", "--port", "8076"]`

from nemo-guardrails.

drazvan avatar drazvan commented on August 18, 2024

@d-shree: actions are loaded automatically from the actions.py file when the configuration is loaded from a path. If you're creating the RailsConfig instance with from_content, you need to manually register the actions using rails.register_action. Let me know if this solves the issue with the action not found.

from nemo-guardrails.

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.