多模式的代理系统代表了人工智能领域的革命性进步,无缝地结合了多种数据类型(例如文本,图像,音频和视频),这是一个统一的系统,可以显着增强智能技术的能力。这些系统依赖于可以独立处理,分析和综合各种来源的信息的自主智能代理,从而促进对复杂情况的更深入,更细微的理解。
通过将多模式输入与代理功能合并,这些系统可以实时动态适应不断变化的环境和用户交互,从而提供更敏感和智能的体验。这种融合不仅提高了各个行业的运营效率,而且还提高了人类计算机的相互作用,从而使它们更加流畅,直觉和上下文意识。结果,将多模式的代理框架设置为重塑我们与技术互动和利用技术的方式,在跨部门的无数应用中推动创新。学习目标
> > data Science Blogathon的一部分。 Table of contentsAgentic AI systems with Image Analysis CapabilitiesBuilding a Multi-Modal Agentic System to Explain Stock Behavior From Stock Charts
> deepSeek-r1-distill-qwen-7b
展示了其有效处理复杂数学推理的能力。 除了其数学能力外,DeepSeek-R1-Distill-Qwen-7b在事实提问的任务上表现出色,在GPQA Diamond上得分为49.1%,在数学和事实推理能力之间取得了良好的平衡。
>我们将利用这一模型来解释和找到公司股票行为背后的推理,从库存图表图像中提取信息。
使用Ollama在Google Colab上使用Ollama实施
!pip install crewai crewai_tools !sudo apt update !sudo apt install -y pciutils !pip install langchain-ollama !curl -fsSL https://ollama.com/install.sh | sh !pip install ollama==0.4.2
import threading import subprocess import time def run_ollama_serve(): subprocess.Popen(["ollama", "serve"]) thread = threading.Thread(target=run_ollama_serve) thread.start() time.sleep(5)
!ollama pull deepseek-r1
import os from crewai import Agent, Task, Crew, Process, LLM from crewai_tools import LlamaIndexTool from langchain_openai import ChatOpenAI from crewai_tools import VisionTool vision_tool = VisionTool() os.environ['OPENAI_API_KEY'] ='' os.environ["OPENAI_MODEL_NAME"] = "gpt-4o-mini" llm = LLM( model="ollama/deepseek-r1", )
def create_crew(image_url,image_url1): #Agent For EXTRACTNG INFORMATION FROM STOCK CHART stockchartexpert= Agent( role="STOCK CHART EXPERT", goal="Your goal is to EXTRACT INFORMATION FROM THE TWO GIVEN %s & %s stock charts correctly """%(image_url, image_url1), backstory="""You are a STOCK CHART expert""", verbose=True,tools=[vision_tool], allow_delegation=False ) #Agent For RESEARCH WHY THE STOCK BEHAVED IN A SPECIFIC WAY stockmarketexpert= Agent( role="STOCK BEHAVIOUR EXPERT", goal="""BASED ON THE PREVIOUSLY EXTRACTED INFORMATION ,RESEARCH ABOUT THE RECENT UPDATES OF THE TWO COMPANIES and EXPLAIN AND COMPARE IN SPECIFIC POINTS WHY THE STOCK BEHAVED THIS WAY . """, backstory="""You are a STOCK BEHAVIOUR EXPERT""", verbose=True, allow_delegation=False,llm = llm ) #Task For EXTRACTING INFORMATION FROM A STOCK CHART task1 = Task( description="""Your goal is to EXTRACT INFORMATION FROM THE GIVEN %s & %s stock chart correctly """%((image_url,image_url1)), expected_output="information in text format", agent=stockchartexpert, ) #Task For EXPLAINING WITH ENOUGH REASONINGS WHY THE STOCK BEHAVED IN A SPECIFIC WAY task2 = Task( description="""BASED ON THE PREVIOUSLY EXTRACTED INFORMATION ,RESEARCH ABOUT THE RECENT UPDATES OF THE TWO COMPANIES and EXPLAIN AND COMPARE IN SPECIFIC POINTS WHY THE STOCK BEHAVED THIS WAY.""", expected_output="Reasons behind stock behavior in BULLET POINTS", agent=stockmarketexpert ) #Define the crew based on the defined agents and tasks crew = Crew( agents=[stockchartexpert,stockmarketexpert], tasks=[task1,task2], verbose=True, # You can set it to 1 or 2 to different logging levels ) result = crew.kickoff() return result
text = create_crew("https://www.eqimg.com/images/2024/11182024-chart6-equitymaster.gif","https://www.eqimg.com/images/2024/03262024-chart4-equitymaster.gif") pprint(text)
最终输出
Mamaearth's stock exhibited volatility during the year due to internal<br> challenges that led to significant price changes. These included unexpected<br> product launches and market controversies which caused both peaks and<br> troughs in the share price, resulting in an overall fluctuating trend.<br><br>On the other hand, Zomato demonstrated a generally upward trend in its share<br> price over the same period. This upward movement can be attributed to<br> expanding business operations, particularly with successful forays into<br> cities like Bengaluru and Pune, enhancing their market presence. However,<br> near the end of 2024, external factors such as a major scandal or regulatory<br> issues might have contributed to a temporary decline in share price despite<br> the overall positive trend.<br><br>In summary, Mamaearth's stock volatility stems from internal inconsistencies<br> and external controversies, while Zomato's upward trajectory is driven by<br> successful market expansion with minor setbacks due to external events.
>让我们检查并比较另外两家公司的股票图表中的股价行为 - 欣喜若狂的食品工程和比卡吉食品国际有限公司。
text = create_crew("https://s3.tradingview.com/p/PuKVGTNm_mid.png","https://images.cnbctv18.com/uploads/2024/12/bikaji-dec12-2024-12-b639f48761fab044197b144a2f9be099.jpg?im=Resize,width=360,aspect=fit,type=normal") print(text)
从最终产出可以看出,代理系统对股票图表中的股价行为进行了很好的分析,并比较了对比卡吉(Bikaji)持续性能的趋势的详尽解释,与欢乐的食品公司的看涨模式相比。
以上是如何建立用于股票见解的多模式代理系统?的详细内容。更多信息请关注PHP中文网其他相关文章!