mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
undo agentops api key check
This commit is contained in:
@@ -19,27 +19,16 @@ from crewai.utilities.constants import TRAINED_AGENTS_DATA_FILE, TRAINING_DATA_F
|
|||||||
from crewai.utilities.token_counter_callback import TokenCalcHandler
|
from crewai.utilities.token_counter_callback import TokenCalcHandler
|
||||||
from crewai.utilities.training_handler import CrewTrainingHandler
|
from crewai.utilities.training_handler import CrewTrainingHandler
|
||||||
|
|
||||||
|
|
||||||
def mock_agent_ops_provider():
|
|
||||||
def track_agent(*args, **kwargs):
|
|
||||||
def noop(f):
|
|
||||||
return f
|
|
||||||
|
|
||||||
return noop
|
|
||||||
|
|
||||||
return track_agent
|
|
||||||
|
|
||||||
|
|
||||||
agentops = None
|
agentops = None
|
||||||
|
try:
|
||||||
|
import agentops # type: ignore # Name "agentops" already defined on line 21
|
||||||
|
from agentops import track_agent
|
||||||
|
except ImportError:
|
||||||
|
def track_agent():
|
||||||
|
def noop(f):
|
||||||
|
return f
|
||||||
|
|
||||||
if os.environ.get("AGENTOPS_API_KEY"):
|
return noop
|
||||||
try:
|
|
||||||
import agentops # type: ignore # Name "agentops" already defined on line 21
|
|
||||||
from agentops import track_agent
|
|
||||||
except ImportError:
|
|
||||||
track_agent = mock_agent_ops_provider()
|
|
||||||
else:
|
|
||||||
track_agent = mock_agent_ops_provider()
|
|
||||||
|
|
||||||
|
|
||||||
@track_agent()
|
@track_agent()
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import json
|
import json
|
||||||
import os
|
|
||||||
import uuid
|
import uuid
|
||||||
from concurrent.futures import Future
|
from concurrent.futures import Future
|
||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
@@ -47,12 +46,10 @@ from crewai.utilities.planning_handler import CrewPlanner
|
|||||||
from crewai.utilities.task_output_storage_handler import TaskOutputStorageHandler
|
from crewai.utilities.task_output_storage_handler import TaskOutputStorageHandler
|
||||||
from crewai.utilities.training_handler import CrewTrainingHandler
|
from crewai.utilities.training_handler import CrewTrainingHandler
|
||||||
|
|
||||||
agentops = None
|
try:
|
||||||
if os.environ.get("AGENTOPS_API_KEY"):
|
import agentops
|
||||||
try:
|
except ImportError:
|
||||||
import agentops # type: ignore
|
agentops = None
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from crewai.pipeline.pipeline import Pipeline
|
from crewai.pipeline.pipeline import Pipeline
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import ast
|
import ast
|
||||||
import os
|
|
||||||
from difflib import SequenceMatcher
|
from difflib import SequenceMatcher
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
from typing import Any, List, Union
|
from typing import Any, List, Union
|
||||||
@@ -12,12 +11,10 @@ from crewai.telemetry import Telemetry
|
|||||||
from crewai.tools.tool_calling import InstructorToolCalling, ToolCalling
|
from crewai.tools.tool_calling import InstructorToolCalling, ToolCalling
|
||||||
from crewai.utilities import I18N, Converter, ConverterError, Printer
|
from crewai.utilities import I18N, Converter, ConverterError, Printer
|
||||||
|
|
||||||
agentops = None
|
try:
|
||||||
if os.environ.get("AGENTOPS_API_KEY"):
|
import agentops
|
||||||
try:
|
except ImportError:
|
||||||
import agentops # type: ignore
|
agentops = None
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
OPENAI_BIGGER_MODELS = ["gpt-4o"]
|
OPENAI_BIGGER_MODELS = ["gpt-4o"]
|
||||||
|
|
||||||
|
|||||||
@@ -8,26 +8,16 @@ from crewai.utilities import Converter
|
|||||||
from crewai.utilities.pydantic_schema_parser import PydanticSchemaParser
|
from crewai.utilities.pydantic_schema_parser import PydanticSchemaParser
|
||||||
|
|
||||||
|
|
||||||
def mock_agent_ops_provider():
|
agentops = None
|
||||||
def track_agent(*args, **kwargs):
|
try:
|
||||||
|
from agentops import track_agent
|
||||||
|
except ImportError:
|
||||||
|
def track_agent(name):
|
||||||
def noop(f):
|
def noop(f):
|
||||||
return f
|
return f
|
||||||
|
|
||||||
return noop
|
return noop
|
||||||
|
|
||||||
return track_agent
|
|
||||||
|
|
||||||
|
|
||||||
agentops = None
|
|
||||||
|
|
||||||
if os.environ.get("AGENTOPS_API_KEY"):
|
|
||||||
try:
|
|
||||||
from agentops import track_agent
|
|
||||||
except ImportError:
|
|
||||||
track_agent = mock_agent_ops_provider()
|
|
||||||
else:
|
|
||||||
track_agent = mock_agent_ops_provider()
|
|
||||||
|
|
||||||
|
|
||||||
class Entity(BaseModel):
|
class Entity(BaseModel):
|
||||||
name: str = Field(description="The name of the entity.")
|
name: str = Field(description="The name of the entity.")
|
||||||
|
|||||||
Reference in New Issue
Block a user