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

[repo] fix: add stop command docs/comments for tools augmentation compatibility #2127

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public static class AIConstants
/// <summary>
/// The type of command that will stop the running.
/// </summary>
/// <remarks>
/// This command is incompatible and should not be used with `tools` augmentation
/// </remarks>
public const string StopCommand = "STOP";

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions getting-started/CONCEPTS/ACTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ An action handler is a callback function that is called when an action is trigge

- If the result is a non-empty string, that string is included as the output of the action to the plan. The last output can be accessed in the next triggered action via the state object: `state.temp.lastOutput`.
- If the action handler returns `AI.StopCommandName`, the `run` method will terminate execution.
> **Note:** `AI.StopCommandName` does not work with `tools` augmentation!
- If the result is an empty string and there is a list of predicted commands, the next command in the plan is executed.
- In sequence augmentation, the returned string is appended to the prompt at runtime (see Sequence [Augmentations](./AUGMENTATIONS.md)). This is then used to generate the plan object using defined actions.
- In monologue augmentation, the returned string is used as inner monologue to perform chain-of-thought reasoning by appending instructions to the prompt during runtime (see Monologue [Augmentation](./AUGMENTATIONS.md)). This is for predicing the next action to execute.
Expand Down
2 changes: 2 additions & 0 deletions js/packages/teams-ai/src/AI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ export class AI<TState extends TurnState = TurnState> {
/**
* A text string that can be returned from an action to stop the AI system from continuing
* to execute the current plan.
* @remarks
* This command is incompatible and should not be used with `tools` augmentation
*/
public static readonly StopCommandName = actions.StopCommandName;

Expand Down
2 changes: 2 additions & 0 deletions python/packages/ai/teams/ai/actions/action_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

class ActionTypes(str, Enum):
STOP = "STOP"
"This command is incompatible and should not be used with `tools` augmentation"

UNKNOWN_ACTION = "___UnknownAction___"
FLAGGED_INPUT = "___FlaggedInput___"
FLAGGED_OUTPUT = "___FlaggedOutput___"
Expand Down
Loading