mirror of
https://github.com/crewAIInc/crewAI.git
synced 2025-12-16 12:28:30 +00:00
preparing new version
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "crewai"
|
name = "crewai"
|
||||||
version = "0.79.2"
|
version = "0.79.3"
|
||||||
description = "Cutting-edge framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks."
|
description = "Cutting-edge framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.10,<=3.13"
|
requires-python = ">=3.10,<=3.13"
|
||||||
|
|||||||
@@ -123,6 +123,11 @@ class Agent(BaseAgent):
|
|||||||
@model_validator(mode="after")
|
@model_validator(mode="after")
|
||||||
def post_init_setup(self):
|
def post_init_setup(self):
|
||||||
self.agent_ops_agent_name = self.role
|
self.agent_ops_agent_name = self.role
|
||||||
|
unnacepted_attributes = [
|
||||||
|
"AWS_ACCESS_KEY_ID",
|
||||||
|
"AWS_SECRET_ACCESS_KEY",
|
||||||
|
"AWS_REGION_NAME",
|
||||||
|
]
|
||||||
|
|
||||||
# Handle different cases for self.llm
|
# Handle different cases for self.llm
|
||||||
if isinstance(self.llm, str):
|
if isinstance(self.llm, str):
|
||||||
@@ -146,39 +151,49 @@ class Agent(BaseAgent):
|
|||||||
if api_base:
|
if api_base:
|
||||||
llm_params["base_url"] = api_base
|
llm_params["base_url"] = api_base
|
||||||
|
|
||||||
|
set_provider = model_name.split("/")[0] if "/" in model_name else "openai"
|
||||||
|
|
||||||
# Iterate over all environment variables to find matching API keys or use defaults
|
# Iterate over all environment variables to find matching API keys or use defaults
|
||||||
for provider, env_vars in ENV_VARS.items():
|
for provider, env_vars in ENV_VARS.items():
|
||||||
for env_var in env_vars:
|
if provider == set_provider:
|
||||||
# Check if the environment variable is set
|
for env_var in env_vars:
|
||||||
if "key_name" in env_var:
|
if env_var["key_name"] in unnacepted_attributes:
|
||||||
env_value = os.environ.get(env_var["key_name"])
|
continue
|
||||||
if env_value:
|
# Check if the environment variable is set
|
||||||
# Map key names containing "API_KEY" to "api_key"
|
if "key_name" in env_var:
|
||||||
key_name = (
|
env_value = os.environ.get(env_var["key_name"])
|
||||||
"api_key"
|
print(
|
||||||
if "API_KEY" in env_var["key_name"]
|
f"Checking env var {env_var['key_name']}: {env_value}"
|
||||||
else env_var["key_name"]
|
|
||||||
)
|
)
|
||||||
# Map key names containing "API_BASE" to "api_base"
|
if env_value:
|
||||||
key_name = (
|
# Map key names containing "API_KEY" to "api_key"
|
||||||
"api_base"
|
key_name = (
|
||||||
if "API_BASE" in env_var["key_name"]
|
"api_key"
|
||||||
else key_name
|
if "API_KEY" in env_var["key_name"]
|
||||||
)
|
else env_var["key_name"]
|
||||||
# Map key names containing "API_VERSION" to "api_version"
|
)
|
||||||
key_name = (
|
# Map key names containing "API_BASE" to "api_base"
|
||||||
"api_version"
|
key_name = (
|
||||||
if "API_VERSION" in env_var["key_name"]
|
"api_base"
|
||||||
else key_name
|
if "API_BASE" in env_var["key_name"]
|
||||||
)
|
else key_name
|
||||||
llm_params[key_name] = env_value
|
)
|
||||||
# Check for default values if the environment variable is not set
|
# Map key names containing "API_VERSION" to "api_version"
|
||||||
elif env_var.get("default", False):
|
key_name = (
|
||||||
for key, value in env_var.items():
|
"api_version"
|
||||||
if key not in ["prompt", "key_name", "default"]:
|
if "API_VERSION" in env_var["key_name"]
|
||||||
# Only add default if the key is already set in os.environ
|
else key_name
|
||||||
if key in os.environ:
|
)
|
||||||
llm_params[key] = value
|
print(f"Mapped key name: {key_name}")
|
||||||
|
llm_params[key_name] = env_value
|
||||||
|
# Check for default values if the environment variable is not set
|
||||||
|
elif env_var.get("default", False):
|
||||||
|
for key, value in env_var.items():
|
||||||
|
if key not in ["prompt", "key_name", "default"]:
|
||||||
|
# Only add default if the key is already set in os.environ
|
||||||
|
if key in os.environ:
|
||||||
|
print(f"Using default value for {key}: {value}")
|
||||||
|
llm_params[key] = value
|
||||||
|
|
||||||
self.llm = LLM(**llm_params)
|
self.llm = LLM(**llm_params)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -332,9 +332,9 @@ class CrewAgentExecutor(CrewAgentExecutorMixin):
|
|||||||
if self.crew is not None and hasattr(self.crew, "_train_iteration"):
|
if self.crew is not None and hasattr(self.crew, "_train_iteration"):
|
||||||
train_iteration = self.crew._train_iteration
|
train_iteration = self.crew._train_iteration
|
||||||
if agent_id in training_data and isinstance(train_iteration, int):
|
if agent_id in training_data and isinstance(train_iteration, int):
|
||||||
training_data[agent_id][train_iteration][
|
training_data[agent_id][train_iteration]["improved_output"] = (
|
||||||
"improved_output"
|
result.output
|
||||||
] = result.output
|
)
|
||||||
training_handler.save(training_data)
|
training_handler.save(training_data)
|
||||||
else:
|
else:
|
||||||
self._logger.log(
|
self._logger.log(
|
||||||
@@ -385,4 +385,5 @@ class CrewAgentExecutor(CrewAgentExecutorMixin):
|
|||||||
return CrewAgentParser(agent=self.agent).parse(answer)
|
return CrewAgentParser(agent=self.agent).parse(answer)
|
||||||
|
|
||||||
def _format_msg(self, prompt: str, role: str = "user") -> Dict[str, str]:
|
def _format_msg(self, prompt: str, role: str = "user") -> Dict[str, str]:
|
||||||
|
prompt = prompt.rstrip()
|
||||||
return {"role": role, "content": prompt}
|
return {"role": role, "content": prompt}
|
||||||
|
|||||||
6
uv.lock
generated
6
uv.lock
generated
@@ -604,7 +604,7 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crewai"
|
name = "crewai"
|
||||||
version = "0.79.2"
|
version = "0.79.3"
|
||||||
source = { editable = "." }
|
source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "appdirs" },
|
{ name = "appdirs" },
|
||||||
@@ -725,9 +725,9 @@ dependencies = [
|
|||||||
{ name = "requests" },
|
{ name = "requests" },
|
||||||
{ name = "selenium" },
|
{ name = "selenium" },
|
||||||
]
|
]
|
||||||
sdist = { url = "https://files.pythonhosted.org/packages/64/bd/eff7b633a0b28ff4ed115adde1499e3dcc683e4f0b5c378a4c6f5c0c1bf6/crewai_tools-0.14.0.tar.gz", hash = "sha256:b6ac527633b7018471d892c21ac96bc961a86b6626d996b1ed7d53cd481d4505", size = 816588 }
|
sdist = { url = "https://files.pythonhosted.org/packages/9b/6d/4fa91b481b120f83bb58f365203d8aa8564e8ced1035d79f8aedb7d71e2f/crewai_tools-0.14.0.tar.gz", hash = "sha256:510f3a194bcda4fdae4314bd775521964b5f229ddbe451e5d9e0216cae57f4e3", size = 815892 }
|
||||||
wheels = [
|
wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/6c/40/93cd347d854059cf5e54a81b70f896deea7ad1f03e9c024549eb323c4da5/crewai_tools-0.14.0-py3-none-any.whl", hash = "sha256:eda78fe3c4df57676259d8dd6b2610fa31f89b90909512f15893adb57fb9e825", size = 463703 },
|
{ url = "https://files.pythonhosted.org/packages/c8/ed/9f4e64e1507062957b0118085332d38b621c1000874baef2d1c4069bfd97/crewai_tools-0.14.0-py3-none-any.whl", hash = "sha256:0a804a828c29869c3af3253f4fc4c3967a3f80f06dab22e9bbe9526608a31564", size = 462980 },
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
Reference in New Issue
Block a user