Coder Social home page Coder Social logo

Comments (4)

drazvan avatar drazvan commented on August 18, 2024 1

Thanks for the follow up @Serbernari! Yes, it is now possible. It appears this feature is not documented. There's a brief mention in the docstring for the generate_async function: https://github.com/NVIDIA/NeMo-Guardrails/blob/develop/nemoguardrails/rails/llm/llmrails.py#L491.

[
  {"role": "context", "content": {"user_name": "John"}},
  {"role": "user", "content": "Hello! How are you?"},
  {"role": "assistant", "content": "I am fine, thank you!"},
  {"role": "event", "event": {"type": "UserSilent"}},
  ...
]

So, you have to use "role": "event". The type is important as this will be used for matching. For example, in the above example, a flow would match the UserSilent event with:

define flow 
  event UserSilent
  bot ask question again

Let me know if you need more information at this point. We'll update the docs in the coming weeks.

from nemo-guardrails.

drazvan avatar drazvan commented on August 18, 2024

Not yet, but it's a feature that is already on our short list as it's been requested multiple times. Right now you can do a hack and make a convention to define special canonical forms that represent events e.g.

define user event X
  "event X"

So, essentially when you want to trigger the event, you just send the text "event X".

from nemo-guardrails.

kmj-8 avatar kmj-8 commented on August 18, 2024

okay, thanks @drazvan

from nemo-guardrails.

Serbernari avatar Serbernari commented on August 18, 2024

any update on that?

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.