- eveai_chat_client updated to retrieve static files from the correct (bunny.net) location when a STATIC_URL is defined.
- Defined locations for crewai crew memory. This failed in k8s. - Redis connection for pub/sub in ExecutionProgressTracker adapted to conform to TLS-enabled connections
This commit is contained in:
@@ -32,6 +32,13 @@ def create_app(config_file=None):
|
||||
|
||||
register_cache_handlers(app)
|
||||
|
||||
# Initialize dedicated Redis pubsub pool for ExecutionProgressTracker
|
||||
try:
|
||||
from common.utils.redis_pubsub_pool import create_pubsub_pool
|
||||
create_pubsub_pool(app)
|
||||
except Exception as e:
|
||||
app.logger.error(f"Failed to initialize Redis pubsub pool: {e}")
|
||||
|
||||
from . import specialists, retrievers
|
||||
|
||||
celery = make_celery(app.name, app.config)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import asyncio
|
||||
import json
|
||||
import os
|
||||
import tempfile
|
||||
import time
|
||||
from abc import abstractmethod
|
||||
|
||||
@@ -8,7 +10,7 @@ from crewai.agents.parser import AgentAction, AgentFinish
|
||||
from crewai.crews import CrewOutput
|
||||
from crewai.tools import BaseTool
|
||||
from flask import current_app
|
||||
from pydantic import BaseModel, create_model, Field, ConfigDict
|
||||
from pydantic import BaseModel, create_model, Field, ConfigDict, PrivateAttr
|
||||
from typing import Dict, Type, get_type_hints, Optional, List, Any, Callable
|
||||
|
||||
from common.utils.business_event_context import current_event
|
||||
@@ -74,12 +76,20 @@ class EveAICrewAICrew(Crew):
|
||||
specialist: Any = Field(default=None, exclude=True)
|
||||
name: str = Field(default=None, exclude=True)
|
||||
model_config = ConfigDict(arbitrary_types_allowed=True)
|
||||
_tmp_dir = PrivateAttr(default=None)
|
||||
|
||||
def __init__(self, specialist, name: str, **kwargs):
|
||||
if specialist.tuning:
|
||||
kwargs['output_log_file'] = f"/app/logs/crew_{name}.txt"
|
||||
base_dir = f"/app/logs/crew_{name}/{specialist.task_id}"
|
||||
else:
|
||||
self._tmp_dir = tempfile.TemporaryDirectory(prefix="crewai-")
|
||||
base_dir = self._tmp_dir.name
|
||||
os.environ["CREWAI_STORAGE_DIR"] = base_dir
|
||||
os.environ["CREWAI_STORAGE_PATH"] = base_dir
|
||||
kwargs['output_log_file'] = f"{base_dir}/specialist_log.json"
|
||||
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.specialist = specialist
|
||||
self.name = name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user