Skip to content

Commit

Permalink
linted
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzejay committed Nov 20, 2024
1 parent 52189a4 commit 8a54042
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 35 deletions.
30 changes: 0 additions & 30 deletions path/to/src/crewai/knowledge/source/base_knowledge_source.py

This file was deleted.

3 changes: 1 addition & 2 deletions src/crewai/agent.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import os
import shutil
import subprocess
from typing import Any, List, Literal, Optional, Union, Dict
from typing import Any, List, Literal, Optional, Union

from pydantic import Field, InstanceOf, PrivateAttr, model_validator

from crewai.agents import CacheHandler
from crewai.agents.agent_builder.base_agent import BaseAgent
from crewai.agents.crew_agent_executor import CrewAgentExecutor
from crewai.cli.constants import ENV_VARS
from crewai.knowledge.knowledge import Knowledge
from crewai.llm import LLM
from crewai.memory.contextual.contextual_memory import ContextualMemory
from crewai.tools import BaseTool
Expand Down
6 changes: 4 additions & 2 deletions src/crewai/crew.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from crewai.memory.long_term.long_term_memory import LongTermMemory
from crewai.memory.short_term.short_term_memory import ShortTermMemory
from crewai.knowledge.knowledge import Knowledge
from crewai.knowledge.source.base_knowledge_source import BaseKnowledgeSource
from crewai.memory.user.user_memory import UserMemory
from crewai.process import Process
from crewai.task import Task
Expand Down Expand Up @@ -276,7 +275,10 @@ def create_crew_memory(self) -> "Crew":
@model_validator(mode="after")
def create_crew_knowledge(self) -> "Crew":
if self.knowledge:
self.knowledge = Knowledge(**self.knowledge)
try:
self.knowledge = Knowledge(**self.knowledge) if isinstance(self.knowledge, dict) else self.knowledge
except (TypeError, ValueError) as e:
raise ValueError(f"Invalid knowledge configuration: {str(e)}")
return self

@model_validator(mode="after")
Expand Down
1 change: 0 additions & 1 deletion src/crewai/knowledge/storage/knowledge_storage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import uuid
import contextlib
import io
import logging
Expand Down

0 comments on commit 8a54042

Please sign in to comment.