mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-04 13:48:31 +00:00
Compare commits
2 Commits
feature/hu
...
feat/log_o
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0684f79ce | ||
|
|
626225e0b7 |
57
log.txt
Normal file
57
log.txt
Normal file
@@ -0,0 +1,57 @@
|
||||
agent=AI LLMs Senior Data Researcher
|
||||
2024-04-04 15:42:20: task=Conduct a thorough research about AI LLMs Make sure you find any interesting and relevant information given the current year is 2024.
|
||||
2024-04-04 15:42:20: status=started
|
||||
agent=AI LLMs Senior Data Researcher
|
||||
2024-04-04 15:44:25: task=1. AI is transforming the curriculum of LLM programs, with law schools incorporating AI-related topics in their courses. (Source: AI and Legal Education: A Primer on AI for Law Students)
|
||||
|
||||
2. Quantitative analysis shows that AI has a significant influence on LLM programs. (Source: The Impact of AI on LLMs: A Quantitative Analysis)
|
||||
|
||||
3. Leading law schools are integrating practical AI applications into their LLM curriculum. (Source: AI in LLMs: A Case Study on Leading Law Schools)
|
||||
|
||||
4. Forecasts predict an increasing integration of AI in LLMs. (Source: The Future of LLMs: A Forecast on AI Integration)
|
||||
|
||||
5. The influence of AI in legal practice is shaping the direction of LLM programs. (Source: Artificial Intelligence in Legal Practice: Implications for Law Schools)
|
||||
|
||||
6. Emerging trends in AI and law include the use of AI in legal research and decision-making. (Source: The Future of AI in Law)
|
||||
|
||||
7. Ethical considerations of using AI in legal practice are now a key component of LLM programs. (Source: AI and Legal Ethics: An Exploration)
|
||||
|
||||
8. AI is significantly transforming legal research, a key skill for LLM students. (Source: Impacts of AI on Legal Research)
|
||||
|
||||
9. AI's influence is evident in contract law, a major area of study in many LLM programs. (Source: The Role of AI in Contract Law)
|
||||
|
||||
10. AI is reshaping the legal profession, influencing the skills taught in LLM programs. (Source: AI and the Future of Legal Practice)2024-04-04 15:44:25: status=completed
|
||||
agent=AI LLMs Reporting Analyst
|
||||
2024-04-04 15:44:25: task=Review the context you got and expand each topic into a full section for a report. Make sure the report is detailed and contains any and all relevant information.
|
||||
2024-04-04 15:44:25: status=started
|
||||
agent=AI LLMs Reporting Analyst
|
||||
2024-04-04 15:46:17: task=# AI Impact on LLM Programs and the Legal Profession: A Comprehensive Report
|
||||
|
||||
## 1. Impact of AI on LLM Programs
|
||||
AI is revolutionizing LLM programs by facilitating personalized learning, automating administrative tasks, and providing a wealth of online resources for research. AI-powered tools analyze students' learning patterns and customize course materials to enhance understanding and retention. [Source: AI and Legal Education: A Primer on AI for Law Students]
|
||||
|
||||
## 2. Integration of Practical AI Applications in LLM Curriculum
|
||||
Law schools are integrating AI into their curriculum to prepare students for the digital transformation in legal practice. This includes teaching students how to use AI for legal research, contract review, and case prediction. [Source: AI in LLMs: A Case Study on Leading Law Schools]
|
||||
|
||||
## 3. Forecasts on AI Integration in LLMs
|
||||
The use of AI in LLM programs is expected to increase in the future. Universities are likely to invest more in AI technologies for teaching and research, and AI may become a standard part of the curriculum. [Source: The Future of LLMs: A Forecast on AI Integration]
|
||||
|
||||
## 4. Influence of AI in Legal Practice
|
||||
AI is making legal practice more efficient and accurate. Software like ROSS and CaseText use AI to help lawyers conduct legal research, while tools like Kira Systems assist in contract review by identifying clauses that are unusual or missing. AI can also help predict case outcomes based on historical data. [Source: Artificial Intelligence in Legal Practice: Implications for Law Schools]
|
||||
|
||||
## 5. Emerging Trends in AI and Law
|
||||
Emerging trends include AI for dispute resolution, predictive analytics for case outcomes, and AI for legal document automation. There's also an increasing focus on 'legaltech' startups that leverage AI to offer innovative legal services. [Source: The Future of AI in Law]
|
||||
|
||||
## 6. Ethical Considerations in Using AI in Legal Practice
|
||||
While AI can improve efficiency, it also raises ethical questions. These include concerns about AI bias, the transparency of AI algorithms, and the potential for AI to replace human lawyers. Legal professionals need to navigate these ethical challenges as they integrate AI into their practice. [Source: AI and Legal Ethics: An Exploration]
|
||||
|
||||
## 7. Transformation of Legal Research by AI
|
||||
AI is transforming legal research by making it faster and more comprehensive. AI tools can analyze vast amounts of legal texts and case law, identify relevant precedents, and even suggest arguments. This allows lawyers to focus more on strategy and less on manual research. [Source: Impacts of AI on Legal Research]
|
||||
|
||||
## 8. AI's Influence in Contract Law
|
||||
AI is being used to review and analyze contracts quickly and accurately. AI can identify standard clauses, flag potential issues, and even suggest changes based on best practices. This reduces human error and makes contract review more efficient. [Source: The Role of AI in Contract Law]
|
||||
|
||||
## 9. How AI is Reshaping the Legal Profession
|
||||
AI is reshaping the legal profession by automating routine tasks, aiding in legal research, and predicting case outcomes. This is changing the role of lawyers and requiring them to develop new skills, such as understanding how to use AI tools effectively. [Source: AI and the Future of Legal Practice]
|
||||
|
||||
In conclusion, AI is having a profound impact on LLM programs and the legal profession as a whole. As AI technologies advance, their influence is likely to grow even stronger.2024-04-04 15:46:17: status=completed
|
||||
@@ -1,5 +1,5 @@
|
||||
import click
|
||||
|
||||
import pkg_resources
|
||||
from .create_crew import create_crew
|
||||
|
||||
|
||||
@@ -15,5 +15,22 @@ def create(project_name):
|
||||
create_crew(project_name)
|
||||
|
||||
|
||||
@crewai.command()
|
||||
@click.option(
|
||||
"--tools", is_flag=True, help="Show the installed version of crewai tools"
|
||||
)
|
||||
def version(tools):
|
||||
"""Show the installed version of crewai."""
|
||||
crewai_version = pkg_resources.get_distribution("crewai").version
|
||||
click.echo(f"crewai version: {crewai_version}")
|
||||
|
||||
if tools:
|
||||
try:
|
||||
tools_version = pkg_resources.get_distribution("crewai[tools]").version
|
||||
click.echo(f"crewai tools version: {tools_version}")
|
||||
except pkg_resources.DistributionNotFound:
|
||||
click.echo("crewai tools not installed")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
crewai()
|
||||
|
||||
@@ -22,7 +22,7 @@ from crewai.process import Process
|
||||
from crewai.task import Task
|
||||
from crewai.telemetry import Telemetry
|
||||
from crewai.tools.agent_tools import AgentTools
|
||||
from crewai.utilities import I18N, Logger, RPMController
|
||||
from crewai.utilities import I18N, Logger, RPMController, FileHandler
|
||||
|
||||
|
||||
class Crew(BaseModel):
|
||||
@@ -49,6 +49,7 @@ class Crew(BaseModel):
|
||||
_execution_span: Any = PrivateAttr()
|
||||
_rpm_controller: RPMController = PrivateAttr()
|
||||
_logger: Logger = PrivateAttr()
|
||||
_file_handler: FileHandler = PrivateAttr()
|
||||
_cache_handler: InstanceOf[CacheHandler] = PrivateAttr(default=CacheHandler())
|
||||
model_config = ConfigDict(arbitrary_types_allowed=True)
|
||||
tasks: List[Task] = Field(default_factory=list)
|
||||
@@ -88,6 +89,10 @@ class Crew(BaseModel):
|
||||
default="en",
|
||||
description="Language used for the crew, defaults to English.",
|
||||
)
|
||||
output_log_file: Optional[Union[bool, str]] = Field(
|
||||
default=False,
|
||||
description="Will create a log file with the output of the crew execution.",
|
||||
)
|
||||
|
||||
@field_validator("id", mode="before")
|
||||
@classmethod
|
||||
@@ -118,6 +123,7 @@ class Crew(BaseModel):
|
||||
"""Set private attributes."""
|
||||
self._cache_handler = CacheHandler()
|
||||
self._logger = Logger(self.verbose)
|
||||
self._file_handler = FileHandler(self.output_log_file)
|
||||
self._rpm_controller = RPMController(max_rpm=self.max_rpm, logger=self._logger)
|
||||
self._telemetry = Telemetry()
|
||||
self._telemetry.set_tracer()
|
||||
@@ -236,6 +242,10 @@ class Crew(BaseModel):
|
||||
self._logger.log(
|
||||
"info", f"== Starting Task: {task.description}", color="bold_yellow"
|
||||
)
|
||||
if self._file_handler:
|
||||
self._file_handler.log(
|
||||
agent=role, task=task.description, status="started"
|
||||
)
|
||||
|
||||
output = task.execute(context=task_output)
|
||||
if not task.async_execution:
|
||||
@@ -243,6 +253,8 @@ class Crew(BaseModel):
|
||||
|
||||
role = task.agent.role if task.agent is not None else "None"
|
||||
self._logger.log("debug", f"== [{role}] Task output: {task_output}\n\n")
|
||||
if self._file_handler:
|
||||
self._file_handler.log(agent=role, task=task_output, status="completed")
|
||||
|
||||
self._finish_execution(task_output)
|
||||
return self._format_output(task_output)
|
||||
@@ -264,12 +276,19 @@ class Crew(BaseModel):
|
||||
for task in self.tasks:
|
||||
self._logger.log("debug", f"Working Agent: {manager.role}")
|
||||
self._logger.log("info", f"Starting Task: {task.description}")
|
||||
|
||||
if self._file_handler:
|
||||
self._file_handler.log(
|
||||
agent=manager.role, task=task.description, status="started"
|
||||
)
|
||||
task_output = task.execute(
|
||||
agent=manager, context=task_output, tools=manager.tools
|
||||
)
|
||||
|
||||
self._logger.log("debug", f"[{manager.role}] Task output: {task_output}")
|
||||
if self._file_handler:
|
||||
self._file_handler.log(
|
||||
agent=manager.role, task=task_output, status="completed"
|
||||
)
|
||||
|
||||
self._finish_execution(task_output)
|
||||
return self._format_output(task_output), manager._token_process.get_summary()
|
||||
|
||||
@@ -5,3 +5,4 @@ from .logger import Logger
|
||||
from .printer import Printer
|
||||
from .prompts import Prompts
|
||||
from .rpm_controller import RPMController
|
||||
from .fileHandler import FileHandler
|
||||
|
||||
20
src/crewai/utilities/fileHandler.py
Normal file
20
src/crewai/utilities/fileHandler.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import os
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class FileHandler:
|
||||
"""take care of file operations, currently it only logs messages to a file"""
|
||||
|
||||
def __init__(self, file_path):
|
||||
if isinstance(file_path, bool):
|
||||
self._path = os.path.join(os.curdir, "logs.txt")
|
||||
elif isinstance(file_path, str):
|
||||
self._path = file_path
|
||||
else:
|
||||
raise ValueError("file_path must be either a boolean or a string.")
|
||||
|
||||
def log(self, **kwargs):
|
||||
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
message = f"{now}: ".join([f"{key}={value}" for key, value in kwargs.items()])
|
||||
with open(self._path, "a") as file:
|
||||
file.write(message + "\n")
|
||||
Reference in New Issue
Block a user