Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/baiyuqi_agentic-society.json
T

1 line
2.8 KiB
JSON

{"repo": "baiyuqi/agentic-society", "files": {"learn/app.py": {"19b4def376eafa922e7c56d380b8993522838fae": {"t": 1785674175.6134863, "n": 2534, "h": "6b25a6fe317ab315", "c": "import os\nfrom crewai import Agent, Task, Crew, Process\nfrom langchain_community.llms.chatglm import ChatGLM\nfrom langchain.agents import Tool\nfrom langchain_community.tools import DuckDuckGoSearchRun\n\nfrom langchain_community.chat_models import ChatZhipuAI\n\nllm = ChatZhipuAI(\n model=\"glm-4\",\n api_key=\"a075eb3edebc5741d238284820988035.6k1unECbt6xLUxfG\",\n)\n\nsearch_tool = DuckDuckGoSearchRun()\n\n# Define your agents with roles and goals\nresearcher = Agent(\n role='Senior Research Analyst',\n goal='Uncover cutting-edge developments in AI and data science',\n backstory=\"\"\"You work at a leading tech think tank.\n Your expertise lies in identifying emerging trends.\n You have a knack for dissecting complex data and presenting actionable insights.\"\"\",\n verbose=True,\n allow_delegation=False,\n tools=[search_tool],\n # You can pass an optional llm attribute specifying what model you wanna use.\n # It can be a local model through Ollama / LM Studio or a remote\n # model like OpenAI, Mistral, Antrophic or others (https://docs.crewai.com/how-to/LLM-Connections/)\n #\n # import os\n # os.environ['OPENAI_MODEL_NAME'] = 'gpt-3.5-turbo'\n #\n # OR\n #\n # from langchain_openai import ChatOpenAI\n llm=llm\n)\nwriter = Agent(\n role='Tech Content Strategist',\n goal='Craft compelling content on tech advancements',\n backstory=\"\"\"You are a renowned Content Strategist, known for your insightful and engaging articles.\n You transform complex concepts into compelling narratives.\"\"\",\n verbose=True,\n allow_delegation=True,\n llm=llm\n)\n\n# Create tasks for your agents\ntask1 = Task(\n description=\"\"\"Conduct a comprehensive analysis of the latest advancements in AI in 2024.\n Identify key trends, breakthrough technologies, and potential industry impacts.\"\"\",\n expected_output=\"Full analysis report in bullet points\",\n verbose=True,\n agent=researcher\n)\n\ntask2 = Task(\n description=\"\"\"Using the insights provided, develop an engaging blog\n post that highlights the most significant AI advancements.\n Your post should be informative yet accessible, catering to a tech-savvy audience.\n Make it sound cool, avoid complex words so it doesn't sound like AI.\"\"\",\n expected_output=\"Full blog post of at least 4 paragraphs\",\n agent=writer\n)\n\n# Instantiate your crew with a sequential process\ncrew = Crew(\n agents=[researcher, writer],\n tasks=[task1, task2],\n verbose=2, # You can set it to 1 or 2 to different logging levels\n)\n\n# Get your crew to work!\nresult = crew.kickoff()\n\nprint(\"######################\")\nprint(result)"}}}}