NVIDIA / NeMo-Guardrails

NeMo Guardrails is an open-source toolkit for easily adding programmable guardrails to LLM-based conversational systems.
Other
4.23k stars 403 forks source link

Colang 2.0 dict error #640

Closed geraldhahn closed 4 months ago

geraldhahn commented 4 months ago

Hi, I tried to use Colang 2.0 recently and implemented the simple tutorial script provided by NeMo guardrails.

The config.co file looks like this:

import core import llm

flow main activate llm continuation activate greeting

flow greeting user expressed greeting bot express greeting

flow user expressed greeting user said 'hi' or user said 'hello'

flow bot express greeting bot say 'Hello World!'

When I run the code and input another greeting aside from 'hi' or 'hello', just like 'hi there', I get the following error message:

\nemoguardrails\colang\v2_x\runtime\serialization.py", line 107, in encode_to_dict raise Exception(f"Unhandled type in encode_to_dict: {type(obj)}") Exception: Unhandled type in encode_to_dict: <class 'set'>

This seems to be an internal encoding error. Does anyone know how to fix this?

Thanks !

Pouyanpi commented 4 months ago

Hi @geraldhahn, thanks for opening this issue.

The fix to this problem is already merged to the develop branch and will be available in 0.10.0 release. You can use the develop branch and install NeMo Guardrails from there.

geraldhahn commented 4 months ago

Thanks !

Pouyanpi commented 4 months ago

Hi @geraldhahn,

Please try v0.9.1 release which was published yesterday.