Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/colang nb changes #394

Merged
merged 20 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e5a21c8
Add missing core library flow variables
schuellc-nvidia Feb 29, 2024
d19c216
Fix standard library issue in state tracking flows
schuellc-nvidia Mar 4, 2024
ab64dce
Replace some log statements in standard library with print statement
schuellc-nvidia Mar 4, 2024
07518a6
Add import_paths to ignore list for config merging
schuellc-nvidia Mar 4, 2024
75784a8
Expose all event arguments as attributes of events
schuellc-nvidia Mar 4, 2024
d23a784
Fix some more flow names in standard library
schuellc-nvidia Mar 4, 2024
d56622c
Add file name to parsing error
schuellc-nvidia Mar 6, 2024
be85f1c
Change some log to print statement for better visibility
schuellc-nvidia Mar 6, 2024
59df028
Fix action lifetime when shared in concurrent flows
schuellc-nvidia Mar 7, 2024
c402508
Expose action context variables directly as action attributes
schuellc-nvidia Mar 8, 2024
b29676f
Add new example about how to call a custom llm prompt using a python …
schuellc-nvidia Mar 8, 2024
ad3915c
Remove deprecated test
schuellc-nvidia Mar 11, 2024
2a728e7
Update core flow library
schuellc-nvidia Mar 11, 2024
ee632ea
Update Colang core library
schuellc-nvidia Mar 11, 2024
b024ec8
Some simple renaming
schuellc-nvidia Mar 12, 2024
338ef65
Generate proper action events in chat CLI
schuellc-nvidia Mar 12, 2024
9822569
Make colang core library accessible for other colang scripts
schuellc-nvidia Mar 12, 2024
74d5783
Update Colang 2.0 VSCode code highlighting extension
schuellc-nvidia Mar 13, 2024
8942372
Formatting fix.
drazvan Mar 13, 2024
7c01f77
Merge branch 'develop' into feature/colang-nb-changes
drazvan Mar 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix some more flow names in standard library
  • Loading branch information
schuellc-nvidia committed Mar 12, 2024
commit d23a7840711d4cf151e5e9a1a80397553d9c5950
20 changes: 10 additions & 10 deletions tests/test_configs/multi_modal_demo_v2_x/core_flow_library.co
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ flow bot suggest $text
# DON'T CHANGE! Currently, hard-wired with LLM prompt generation
# -----------------------------------

flow track bot talking state
flow tracking of bot talking state
# meta: loop_id=state_tracking
global $bot_talking_state
if $user_talking_state == None
Expand All @@ -266,7 +266,7 @@ flow track bot talking state
await bot said something
$bot_talking_state = False

flow track user talking state
flow tracking of user talking state
# meta: loop_id=state_tracking
global $user_talking_state
if $user_talking_state == None
Expand All @@ -276,15 +276,15 @@ flow track user talking state
await user said something
$user_talking_state = False

flow track unhandled user intent state
flow tracking of unhandled user intent state
# meta: loop_id=state_tracking
global $user_intent_state
when unhandled user intent as $flow
$unhandled_user_intent_state = $flow.context.flow_name
orwhen FlowFinished(flow_id=r"^user ") as $event
$unhandled_user_intent_state = None

flow track visual choice selection state
flow tracking of visual choice selection state
# meta: loop_id=state_tracking
global $choice_selection_state
when VisualChoiceSceneAction.Started()
Expand Down Expand Up @@ -323,24 +323,24 @@ flow wait $time_s $timer_id="wait_timer_{{uid()}}"
# meta: loop_id=NEW
await TimerBotAction(timer_name=$timer_id, duration=$time_s)

flow catch colang errors
"""A flow to catch any runtime Colang errors"""
flow catching of colang errors
"""A flow to catching of any runtime Colang errors"""
# meta: loop_id=catch_colang_errors
match ColangError() as $event
print "Colang error: {{$event.error_type}} - {{escape($event.error)}}"
bot say "Excuse me, what did you say?"

flow catch undefined flows
"""A flow to catch the start of undefined flows."""
flow catching of undefined flows
"""A flow to catching of the start of undefined flows."""
priority 0.1
match UnhandledEvent(event="StartFlow") as $event
print "Undefined flow: '{{$event.flow_id}}' {{$event.loop_ids}}"
bot say "Excuse me, what did you say?"
# We need to abort the flow that sent the FlowStart event since it might be waiting for it
send StopFlow(flow_instance_uid=$event.source_flow_instance_uid)

flow catch unexpected user utterance
"""A flow to catch unhandled user utterances."""
flow catching of unexpected user utterance
"""A flow to catching of unhandled user utterances."""
priority 0.1
match UnhandledEvent(event="UtteranceUserActionFinished") as $event
bot say "Warning: Unexpected user utterance '{{$event.final_transcript}}'"
Expand Down
10 changes: 5 additions & 5 deletions tests/test_configs/multi_modal_demo_v2_x/demo.co
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ flow check limitations with user


flow showcase selector
activate track visual choice selection state
activate tracking of visual choice selection state

$showcase_selection_ui = None
global $bot_talking_state
Expand Down Expand Up @@ -278,12 +278,12 @@ flow showcase selector

flow main
# meta: exclude from llm
#activate catch unexpected user utterance
#activate catching of unexpected user utterance
activate ignored_utterance_action_bugfix
activate catch undefined flows
activate catch colang errors
activate catching of undefined flows
activate catching of colang errors
activate poll llm request response 1.0
activate track bot talking state
activate tracking of bot talking state
#activate faq

start scene show textual information $title="Welcome to the Tech Demo of Colang 2.0" $text="" $header_image="https://blogs.nvidia.com/wp-content/uploads/2023/04/NeMo-Guardrails-KV-x1280.jpg" as $welcome_ui
Expand Down