Skip to content

Commit

Permalink
[repo] fix: add stop command docs/comments for tools augmentation com…
Browse files Browse the repository at this point in the history
…patibility (#2127)

## Linked issues

closes: #2126 

## Details

Context: #2126 

Adding comments to communicate that the `StopCommand` is not compatible
with the `tools` augmentation.
  • Loading branch information
aacebo authored Oct 21, 2024
1 parent bc67f11 commit eb10850
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
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

0 comments on commit eb10850

Please sign in to comment.