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
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
Some simple renaming
  • Loading branch information
schuellc-nvidia committed Mar 12, 2024
commit b024ec8d3a0815f42244dd35cb627dfffd5ec97a
22 changes: 11 additions & 11 deletions nemoguardrails/colang/v2_x/runtime/statemachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def run_to_completion(state: State, external_event: Union[dict, Event]) -> State
heads_matching, key=lambda x: x.matching_scores, reverse=True
)

_handle_internal_event_matching(state, event, heads_matching)
_handle_event_matching(state, event, heads_matching)

if isinstance(event, ActionEvent):
# Update actions status in all active flows by current action event
Expand Down Expand Up @@ -568,7 +568,7 @@ def _get_all_head_candidates(state: State, event: Event) -> List[Tuple[str, str]
return sorted_head_candidates


def _handle_internal_event_matching(
def _handle_event_matching(
state: State, event: Event, heads_matching: List[FlowHead]
) -> None:
for head in heads_matching:
Expand Down Expand Up @@ -698,9 +698,9 @@ def _resolve_action_conflicts(
index = competing_flow_state.action_uids.index(
competing_event.action_uid
)
competing_flow_state.action_uids[
index
] = winning_event.action_uid
competing_flow_state.action_uids[index] = (
winning_event.action_uid
)
del state.actions[competing_event.action_uid]

advancing_heads.append(head)
Expand Down Expand Up @@ -861,31 +861,31 @@ def slide(

if isinstance(element, SpecOp):
if element.op == "send":
action_event = get_event_from_element(state, flow_state, element)
event = get_event_from_element(state, flow_state, element)

if action_event.name not in InternalEvents.ALL:
if event.name not in InternalEvents.ALL:
# It's an action event and we need to stop
break

# Add source flow information to event
action_event.arguments.update(
event.arguments.update(
{
"source_flow_instance_uid": head.flow_state_uid,
"source_head_uid": head.uid,
}
)

if action_event.name == InternalEvents.START_FLOW:
if event.name == InternalEvents.START_FLOW:
# Add flow hierarchy information to event
action_event.arguments.update(
event.arguments.update(
{
"flow_hierarchy_position": flow_state.hierarchy_position
+ f".{head.position}",
}
)

new_event = create_internal_event(
action_event.name, action_event.arguments, head.matching_scores
event.name, event.arguments, head.matching_scores
)
_push_internal_event(state, new_event)
head.position += 1
Expand Down