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

Use CREWAI_PROMPT_FILE environment variable. #777

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mbarnathan
Copy link

CrewAI initializes several I18N instances deep within the library at package initialization time, using the default prompts.
Despite the ability to specify prompt files within a Crew, the defaults will still be used in several places throughout the
workflow of calling that Crew. Overriding the defaults consistently throughout the package currently requires monkeypatching.

This change will allow overriding the default prompt file location in the $CREWAI_PROMPT_FILE environment variable, allowing consistency throughout the library.

CrewAI initializes several I18N instances deep within the library
at package initialization time, using the default prompts.
This makes overriding the defaults consistently throughout the
package very difficult, requiring monkeypatching.

This change will allow overriding the default prompt file location
in the $CREWAI_PROMPT_FILE environment variable, allowing
consistency throughout the library.
@joaomdmoura
Copy link
Collaborator

Despite the ability to specify prompt files within a Crew, the defaults will still be used in several places throughout the
workflow of calling that Crew

Oh interesting I didn't realize that was the case, wouldn't that still be a problem even if we use the ENV var thought given the current changes? I might be missing something it's 1am lol

@mbarnathan
Copy link
Author

mbarnathan commented Jul 6, 2024

Most manually initialized objects can be passed a custom I18N object, but the main problem was the CrewAgentExecutor import calling into Prompts with the default I18N object (I think this is occurring through the memory function). This is being initialized in the agents package's __ init __.py, which prevents getting an override in via a parameter early. You're either stuck with layers of deep overrides of core Crew classes such as CrewAgentExecutor or something like an environment variable or monkeypatching I18N that applies globally.

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.

None yet

2 participants