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

[FEAT] Global Memory Labels #571

Merged
merged 13 commits into from
Nov 25, 2024
Merged

Conversation

jsong468
Copy link
Contributor

@jsong468 jsong468 commented Nov 21, 2024

This PR adds GLOBAL_MEMORY_LABELS as a .env.local environment variable that flows through to all prompts sent through an Orchestrator.

  • self._global_memory_labels is initialized in the constructor of the Orchestrator base class via default_values.get_non_required_value so that every orchestrator will apply those labels to all prompts saved as memory entries.
  • Individual orchestrator classes no longer have memory_labels as a constructor parameter.
  • The functionality to have custom memory labels outside of the environment variable is maintained via PromptSendingOrchestrator's send_prompts_async function and MultiTurnOrchestrator's apply_attack_async. Any labels passed in through these functions take precedence over the global ones in the case of collisions, allowing for users to specify temporary labels for any batch of prompts they send.

Testing:

  • Relevant docs updated accordingly (+ a new PSO example) and re-ran
  • Tests added for GLOBAL_MEMORY_LABELS and other relevant tests were updated and re-ran
  • Wiki updated

.env_example Outdated Show resolved Hide resolved
@jsong468 jsong468 merged commit 2ea7fe3 into Azure:main Nov 25, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants