将 CrewAI 与 Elasticsearch 结合使用
作者:来自 Elastic Jeffrey Rengifo
学习如何使用 CrewAI 为你的代理团队创建一个 Elasticsearch 代理,并执行市场调研任务。
CrewAI 是一个用于编排代理的框架,它通过角色扮演的方式让多个代理协同完成复杂任务。
如果你想了解更多关于代理及其工作原理的内容,建议你阅读这篇文章。

CrewAI 声称比类似的框架(如 LangGraph)更快速、更简单,因为它不需要像 Autogen 那样大量的样板代码或额外的代理编排代码。此外,CrewAI 与 Langchain 工具兼容,带来了更多可能性。
CrewAI 的应用场景十分广泛,包括研究代理、股市分析、潜在客户捕捉、合同分析、网站生成、旅行推荐等。
在本文中,你将创建一个使用 Elasticsearch 作为数据检索工具的代理,与其他代理协作,对我们的 Elasticsearch 产品进行市场调研。
基于诸如 “summer clothes - 夏季服装” 这样的概念,专家代理(expert agent)将会在 Elasticsearch 中搜索最具语义相似性的产品;研究员代理(researcher agen)则会在网上查找相关的网站和产品;最后,写作代理(writer agent)会将所有内容整合成一份市场分析报告。
你可以在这里找到包含完整示例的 Notebook。
要使这组代理(crew agent)正常运行,请完成以下步骤:
步骤如下:
-
安装并导入相关包
-
准备数据
-
创建 Elasticsearch 的 CrewAI 工具
-
配置代理
-
配置任务
安装并导入包
pip install elasticsearch==8.17 'crewai[tools]'
import json
import osfrom getpass import getpass
from elasticsearch import Elasticsearch
from elasticsearch.helpers import bulkfrom crewai import Agent, Crew, Task
from crewai.tools import tool
from crewai_tools import SerperDevTool, WebsiteSearchTool
我们导入 SerperDevTool 以使用 Serper API 在互联网上搜索与我们的查询相关的网站,并使用 WebsiteSearchTool 在找到的内容中进行 RAG 搜索。
Serper 提供 2,500 次免费查询,你可以在这里领取。
准备数据
Elasticsearch 客户端
os.environ["ELASTIC_ENDPOINT"] = "your_es_url"
os.environ["ELASTIC_API_KEY"] = "es_api_key"_client = Elasticsearch(os.environ["ELASTIC_ENDPOINT"],api_key=os.environ["ELASTIC_API_KEY"],
)
创建推理端点
为了启用语义搜索功能,你需要使用 ELSER 创建一个推理端点:
_client.options(request_timeout=60, max_retries=3, retry_on_timeout=True
).inference.put(task_type="sparse_embedding",inference_id="clothes-inference",body={"service": "elasticsearch","service_settings": {"adaptive_allocations": { "enabled": True},"num_threads": 1,"model_id": ".elser_model_2" }}
)
创建映射
现在,我们将把 ELSER 模型应用于一个单一的 semantic_text 字段,以便使代理能够运行混合查询。
_client.indices.create(index="summer-clothes",body={"mappings": {"properties": {"title": {"type": "text","copy_to": "semantic_field"},"description": {"type": "text","copy_to": "semantic_field"},"price": {"type": "float"},"semantic_field": {"type": "semantic_text","inference_id": "clothes-inference"}}}})
索引数据
我们将存储一些关于衣服的数据,以便将我们的来源与研究员代理在互联网上找到的信息进行比较。
documents = [{"title": "Twist-Detail Crop Top","description": "Fitted crop top in woven, patterned fabric with linen content. Wide shoulder straps, sweetheart neckline, and gathered side seams for a gently draped effect. Twisted detail at center bust, cut-out section at front, and wide smocking at back. Lined","price": 34.99},{"title": "Rib-knit Tank Top","description": "Short, fitted top in a soft rib knit. Extra-narrow shoulder straps and a square neckline.","price": 7.49},{"title": "Linen-blend Shorts","description": "Shorts in an airy, woven linen blend. High, ruffle-trimmed waist, narrow drawstring and covered elastic at waistband, and discreet side pockets.","price": 13.99},{"title": "Twill Cargo Shorts","description": "Fitted shorts in cotton twill with a V-shaped yoke at front and back. High waist, zip fly with button, and patch front pockets.","price": 20.99},{"title": "Slim Fit Ribbed Tank Top","description": "Slim-fit tank top in medium weight, ribbed cotton-blend jersey with a fitted silhouette. Straight-cut hem.","price": 8.49},{"title": "Relaxed Fit Linen Resort Shirt","description": "Relaxed-fit shirt in airy linen. Resort collar, buttons without placket, yoke at back, and short sleeves. Straight-cut hem. Fabric made from linen is breathable, looks great when ironed or wrinkled, and softens over time.","price": 17.99},{"title": "Swim Shorts","description": "Swim shorts in woven fabric. Drawstring and covered elastic at waistband, side pockets, and a back pocket with hook-loop fastener. Small slit at sides. Mesh liner shorts.","price": 14.99},{"title": "Baggy Fit Cargo Shorts","description": "Baggy-fit cargo shorts in cotton canvas with a generous but not oversized silhouette. Zip fly with button, diagonal side pockets, back pockets with flap and snap fasteners, and bellows leg pockets with snap fasteners.","price": 20.99},{"title": "Muslin Shorts","description": "Shorts in airy cotton muslin. High, ruffle-trimmed waist, covered elastic at waistband, and an extra-narrow drawstring with a bead at ends. Discreet side pockets.","price": 15.99},{"title": "Oversized Lyocell-blend Dress","description": "Short, oversized dress in a woven lyocell blend. Gathered, low-cut V-neck with extra-narrow ties at front, 3/4-length, raglan-cut balloon sleeves with narrow elastic at cuffs, and seams at waist and hips with delicate piping. Unlined.","price": 38.99}
]def build_data():for doc in documents:yield {"_index": "summer-clothes","_source": doc}try:success, errors = bulk(_client, build_data())print(f"{success} documents indexed successfully")if errors:print("Errors during indexing:", errors)except Exception as e:print(f"Error: {str(e)}")
创建 Elasticsearch CrewAI 工具
CrewAI 的工具装饰器简化了将常规 Python 函数转换为代理可以使用的工具。以下是我们如何创建一个 Elasticsearch 搜索工具:
@tool("es tool")
def elasticsearch_tool(question: str) -> str:"""Search in Elasticsearch using hybrid search capabilities.Args:question (str): The search query to be semantically matchedReturns:str: Concatenated hits from Elasticsearch as string JSON"""response = _client.search(index="summer-clothes",body={"size": 10,"_source": {"includes": ["description", "title", "price"]},"retriever": {"rrf": {"retrievers": [{"standard": {"query": {"match": {"title": question}}}},{"standard": {"query": {"semantic": {"field": "semantic_field","query": question,}}}},]}},},)hits = response["hits"]["hits"]if not hits:return ""result = json.dumps([hit["_source"] for hit in hits], indent=2)return result
导入其他需要的工具和凭证
现在,我们实例化一开始准备的工具,用于在互联网上搜索并在找到的内容中进行 RAG。
你还需要一个 OpenAI API 密钥,用于与 LLM 的通信。
os.environ["SERPER_API_KEY"] = "your-key"
os.environ["OPENAI_API_KEY"] = "your-key"search_tool = SerperDevTool()
web_rag_tool = WebsiteSearchTool()
配置代理
现在,你需要定义代理:
-
检索器/Retriever:能够使用之前创建的工具在 Elasticsearch 中进行搜索。
-
研究员/Researcher:使用 search_tool 在互联网上搜索。
-
撰写者/Writer:将来自其他两个代理的信息总结成一个 Markdown 博客文件。
es_retriever_agent = Agent(role="Retriever",goal="Retrieve Elasticsearch documents",backstory="You are an expert researcher",tools=[elasticsearch_tool],verbose=True,
)internet_researcher_agent = Agent(role="Research analyst",goal="Provide up-to-date market analysis of the industry",backstory="You are an expert analyst",tools=[search_tool, web_rag_tool],verbose=True,
)writer_agent = Agent(role="Content Writer",goal="Craft engaging blog posts about the information gathered",backstory="A skilled writer with a passion for writing about fashion",tools=[],verbose=True,
)
配置任务
现在你已经定义了代理和工具,你需要为每个代理创建任务。你将指定不同的任务,以包括内容来源,以便撰写者代理能够引用它们,确保检索器和研究员代理都在提供信息。
es_retriever_task = Task(description="Retrieve documents from the Elasticsearch index.",expected_output="A list of documents retrieved from the Elasticsearch index based on the query.",agent=es_retriever_agent,
)internet_research_task = Task(description="Conduct research on the latest fashion trends for summer 2025. Identify five key trends that are shaping the industry, including popular colors, fabrics, and styles. Use reliable sources such as fashion magazines, retail market reports, and industry analyses. For each trend, provide a concise summary explaining its significance and why it is gaining popularity. Clearly cite your sources using a format like [Source Name]. Your response should be structured and fact-based",expected_output="A structured summary of the top five fashion trends for summer 2025, including citations for each trend in the format [Source Name]",agent=internet_researcher_agent,
)write_task = Task(description="Compare the fashion trends from the Research Agent with product listings from Elasticsearch. Write a short report highlighting how the store's products align with trends. Use '[Elasticsearch]' for database references and '[Source Name]' for external sources",expected_output="A short, structured report combining trend insights with product recommendations, with clearly marked references",agent=writer_agent,output_file="blog-posts/new_post.md",
)
现在,你只需要实例化包含所有代理和任务的 crew 并运行它们:
# Use in a crew
crew = Crew(agents=[es_retriever_agent, internet_researcher_agent, writer_agent],tasks=[es_retriever_task,internet_research_task,write_task,],
)# Execute tasks
crew.kickoff()
我们可以在 new_post.md 文件中看到结果:
“**Short Report on Fashion Trends and Product Alignment**In this report, we will explore how the current fashion trends for summer 2025 align with the offerings in our store, as evidenced by product listings from [Elasticsearch]. The analysis focuses on five prominent trends and identifies specific products that reflect these aesthetics.**1. Romantic Florals with Kitsch Twist**The resurgence of floral patterns, particularly those that are intricate rather than large, embodies a whimsical approach to summer fashion. While our current inventory lacks offerings specifically featuring floral designs, there is an opportunity to curate products that align with this trend, potentially expanding into tops or dresses adorned with delicate floral patterns. [Source: Teen Vogue]**2. High Waisted and Baggy Silhouettes**High-waisted styles are a key trend for summer 2025, emphasizing comfort without sacrificing style. Among our offerings, the following products fit this criterion:- **Baggy Fit Cargo Shorts** ($20.99): These cargo shorts present a relaxed, generous silhouette, complementing the cultural shift towards practical fashion that allows ease of movement.- **Twill Cargo Shorts** ($20.99): These fitted options also embrace the high-waisted trend, providing versatility for various outfits.**3. Bold Colors: Turquoise and Earthy Tones**This summer promises a palette of vibrant turquoise alongside earthy tones. While our current collection does not showcase products that specifically reflect these colors, introducing pieces such as tops, dresses, or accessories in these hues could strategically cater to this emerging aesthetic. [Source: Heuritech]**4. Textured Fabrics**As textured fabrics gain popularity, we recognize an opportunity in our offerings:- **Oversized Lyocell-blend Dress** ($38.99): This dress showcases unique fabric quality with gathered seams and balloon sleeves, making it a textural delight that speaks to the trend of tactile experiences in fashion.- **Twist-Detail Crop Top** ($34.99): Featuring gathered side seams and a twist detail, it embraces the layered, visually engaging designs consumers are seeking.**5. Quiet Luxury**Quiet luxury resonates with those prioritizing quality and sustainability over fast fashion. Our offerings in this category include:- **Relaxed Fit Linen Resort Shirt** ($17.99): This piece’s breathable linen fabric and classic design underline a commitment to sustainable, timeless pieces that exemplify understated elegance.In conclusion, our current product listings from [Elasticsearch] demonstrate alignment with several key summer fashion trends for 2025. There are unique opportunities to further harness these trends by expanding our collection to include playful floral designs and vibrant colors. Additionally, leveraging the existing offerings that emphasize comfort and quality can enhance our customer appeal in the face of evolving consumer trends.We are well positioned to make strategic enhancements to our inventory, ensuring we stay ahead in the fast-evolving fashion landscape.”
结论
CrewAI 简化了实例化带有角色扮演的代理工作流的过程,并且支持 Langchain 工具,包括自定义工具,使得通过像工具装饰器这样的抽象方式创建工具变得更加容易。
这个代理 crew 展示了执行结合本地数据源和互联网搜索的复杂任务的能力。
如果你想继续改进这个工作流,你可以尝试创建一个新的代理,将 writer_agent 的结果写入 Elasticsearch!
想要获得 Elastic 认证吗?查找下次 Elasticsearch 工程师培训的时间!
Elasticsearch 拥有许多新功能,可以帮助你为你的使用场景构建最佳搜索解决方案。深入探索我们的示例笔记本,了解更多,开始免费云试用,或者现在就在你的本地机器上尝试 Elastic。
原文:Using CrewAI with Elasticsearch - Elasticsearch Labs
相关文章:
将 CrewAI 与 Elasticsearch 结合使用
作者:来自 Elastic Jeffrey Rengifo 学习如何使用 CrewAI 为你的代理团队创建一个 Elasticsearch 代理,并执行市场调研任务。 CrewAI 是一个用于编排代理的框架,它通过角色扮演的方式让多个代理协同完成复杂任务。 如果你想了解更多关于代理…...
n8n自动化之添加jenkins
n8n自动化之添加jenkins Jenkins添加Api Token 点击“账户”点击“设置” 添加API Token 找到API Token,点击“添加新 Token”输入用户名点击“生成” 复制并保存秘钥 用生成token的用户名和密码填充下面的用户名和密码Jenkins instance URL是Jenkins文件夹的…...
DFS--
数字的全排列 #include <bits/stdc.h> using namespace std;//最大的排列数目 const int N10; int n; //存储排列的路径 int path[N]; //标记数字是否已经被使用 bool st[N];void dfs(int u){//到达递归边界,输出一个排列if(un){//输出循环for(int i0; i<…...
Vue:路由切换表格塌陷
目录 一、 出现场景二、 解决方案 一、 出现场景 当路由切换时,表格操作栏会出现行错乱、塌陷的问题 二、 解决方案 在组件重新被激活的时候刷新表格 <el-table ref"table"></el-table>activated(){this.$nextTick(() > {this.$refs[t…...
Ubuntu进入Recovery模式遇到问题
Ubuntu进入Recovery模式需要按ESC,但是没人告诉你进入后并不显示Advanced option.... 这种菜单,而是下面这个界面: 我分别测试了Ubuntu18和24的版本,都存在这个问题,就是不管你按一次ESC还是一直按着ESC都会进入到这个模式里。 非…...
淘宝API驱动跨境选品:多语言详情页自动翻译与本地化定价
淘宝 API 驱动跨境选品实现多语言详情页自动翻译与本地化定价,为跨境电商业务带来诸多便利与优势,以下是详细介绍: 一、多语言详情页自动翻译 技术原理 借助淘宝的 API 接口,获取商品详情页的各类文本信息,包括标题、描…...
IDEA 2024 Maven 设置为全局本地仓库,避免新建项目重新配置maven
使用idea创建Java项目时每次都要重新配置Maven,非常麻烦。其实IDEA可以配置全局Maven。方法如下: 1.关闭所有项目进入初始页面 2.选择所有配置 3.设置为自己的路径...
C++类成员内存分布详解
本文将探讨C类中成员变量的内存分布情况,包括普通成员、静态成员、虚函数等不同情况下的内存布局。 一、基本成员内存布局 1. 普通成员变量 普通成员变量按照声明顺序在内存中连续排列(受访问修饰符和内存对齐影响): class Nor…...
【PVR】《Palm Vein Recognition and Large-scale Research based on Deep Learning》
邬晓毅. 基于深度学习的掌静脉识别及规模化研究[D]. 四川:电子科技大学,2024. 文章目录 1、背景2、相关工作3、创新点和贡献4、方法和实验4.1、知识介绍4.2、基于自适应损失函数的掌静脉识别算法研究4.3、退化图像的掌静脉识别鲁棒性提升研究4.4、掌静脉识别系统规模化 5、总结…...
【码农日常】vscode编码clang-format格式化简易教程
文章目录 0 前言1 工具准备1.1 插件准备1.2 添加.clang-format1.3 添加配置 2 快速上手 0 前言 各路大神都说clangd好,我也来试试。这篇主要讲格式化部分。 1 工具准备 1.1 插件准备 照图安装。 1.2 添加.clang-format 右键添加文件,跟添加个.h或者.c…...
CExercise_08_字符串_2统计该字符串中每个字符出现的次数,统计过程中忽略大小写的差异,并打印最终每个字符出现的次数。
题目:CExercise_ 给定一个字符串,要求它可能包含数字和字母。 请编写函数,统计该字符串中每个字符出现的次数,统计过程中忽略大小写的差异,并打印最终每个字符出现的次数。 提示: 用一个int数组存储字符出现…...
LabVIEW 中 JSON 数据与簇的转换
在 LabVIEW 编程中,数据格式的处理与转换是极为关键的环节。其中,将数据在 JSON 格式与 LabVIEW 的簇结构之间进行转换是一项常见且重要的操作。这里展示的程序片段就涉及到这一关键功能,以下将详细介绍。 一、JSON 数据与簇的转换功能 &am…...
分布式文件存储系统FastDFS
文章目录 1 分布式文件存储1_分布式文件存储的由来2_常见的分布式存储框架 2 FastDFS介绍3 FastDFS安装1_拉取镜像文件2_构建Tracker服务3_构建Storage服务4_测试图片上传 4 客户端操作1_Fastdfs-java-client2_文件上传3_文件下载4_获取文件信息5_问题 5 SpringBoot整合 1 分布…...
DNS域名解析(以实操为主)
目录 一.正向解析(在Linux下) 1.1什么是正向解析 1.2具体操作 1编辑主配置文件 /etc/named.conf 2编辑域名文件 /etc/named.rfc1912.zones 3根据域名文件中定义的名称,来建立数据库文件 4重启服务 5验证 二.正向解析(在…...
Spark运行架构 RDD相关概念Spark-Core编程
以下是今天学习的知识点: 第三节 Spark运行架构 运行架构 Spark 框架的核心是一个计算引擎,整体来说,它采用了标准 master-slave 的结构。 核心组件 对于 Spark 框架有两个核心组件: Driver Spark 驱动器节点,用…...
校园智能硬件国产化的现状与意义
以下是校园智能硬件国产化的现状与意义: 现状 政策支持力度大:近年来,国家出台了一系列政策推动教育数字化和国产化发展。如2022年教育部等六部门印发《关于推进教育新型基础设施建设构建高质量教育支撑体系的指导意见》,明确提出…...
Android里面如何优化xml布局
在 Android 开发中,以下是系统化的优化方案,从基础到高级分层解析: 一、基础优化策略 1. 减少布局层级 问题:每增加一层布局,测量/布局时间增加 1-2ms 解决方案: <!-- 避免嵌套 --> <LinearLayo…...
Android10.0 framework第三方无源码APP读写断电后数据丢失问题解决
1.前言 在10.0中rom定制化开发中,在某些产品开发中,在某些情况下在App用FileOutputStream读写完毕后,突然断电 会出现写完的数据丢失的问题,接下来就需要分析下关于使用FileOutputStream读写数据的相关流程,来实现相关 功能 2.framework第三方无源码APP读写断电后数据丢…...
LabVIEW驱动开发的解决思路
在科研项目中,常面临将其他语言开发的定制采集设备驱动转换为 LabVIEW 适用形式的难题。特别是当原驱动支持匮乏、开发人员技术支持不足时,如何抉择解决路径成为关键。以下提供具体解决思路,助力高效解决问题。 一、评估现有驱动死磕的可…...
【C++】 —— 笔试刷题day_13
一、牛牛冲钻五 题目描述 题目说,牛牛在玩炉石传说,现在牛牛进行了n场游戏,让我们判断牛牛上了几颗星。 首先输入一个T,表示T组数据; 然后输入n和k,表示一个进行了n场数据,k表示连胜三场及以上…...
【ROS】分布式通信架构
【ROS】分布式通信架构 前言环境要求主机设置(Master)从机设置(Slave)主机与从机通信测试本文示例启动ROS智能车激光雷达节点本地计算机配置与订阅 前言 在使用 ROS 时,我们常常会遇到某些设备计算能力不足的情况。例…...
【第39节】windows编程:打造MFC版本任务管理器
目录 一、项目概述 二、项目开发的各种功能关键 2.1 进程信息的获取 2.2 线程信息的获取 2.3 进程模块信息的获取 2.3.1 模块快照 2.3.2 枚举模块 2.4 进程堆信息的获取 2.5 窗口信息的获取 2.6 文件信息的获取 2.7 内存信息和CPU占用率的获取 2.7.1 内存信息相关结…...
1.认识C语言
上层:应用软件 下层:操作系统、硬件 C语言擅长于下层方面 计算机语言的发展:低级 ——> 高级 用计算机的二进制指令写代码(低级语言) —— > 汇编指令(低级语言,用到了助记符ÿ…...
MySQL下200GB大表备份,利用传输表空间解决停服发版表备份问题
MySQL下200GB大表备份,利用传输表空间解决停服发版表备份问题 问题背景 在停服发版更新时,需对 200GB 大表(约 200 亿行数据)进行快速备份以预防操作失误。 因为曾经出现过有开发写的发版语句里,UPDATE语句的WHERE条…...
《Sqoop 快速上手:安装 + 测试实战》
推荐原文 见:http://docs.xupengboo.top/bigdata/di/sqoop.html Sqoop(SQL-to-Hadoop) 是 Apache 开源的工具,专门用于在 Hadoop 生态系统(如 HDFS、Hive、HBase) 和 关系型数据库(如 MySQL、O…...
MySQL体系架构(二)
MySQL中的目录和文件 2.2.1.bin目录 在MysQL的安装目录下有一个特别特别重要的bin目录,这个目录下存放着许多可执行文件。 其他系统中的可执行文件与此的类似。这些可执行文件都是与服务器程序和客户端程序相关的。 2.2.1.1.启动MySQL服务器程序 在UNIX系统中用来启动MySO…...
为什么反激采用峰值电流控制模式而非电压模式
电压模式控制是传统的控制方法,通过检测输出电压,与参考电压比较,然后调整PWM的占空比。这种方法的优点是简单,只需要一个电压反馈环路。但缺点可能包括对输入电压变化的响应较慢,动态性能不足,尤其是在负载…...
JavaScript逆向工程中的插桩技术完全指南
一、什么是插桩技术? 插桩(Instrumentation)是逆向工程中的核心技术之一,指的是在不改变程序原有逻辑的前提下,向目标程序中插入额外的代码或监控点,用于收集运行时信息、修改程序行为或进行调试分析。 插…...
LLM应用实战1-基本概念
文章目录 基本概念1. 提示词工程(Prompt Engineering)2. AI Agent(智能代理)3. Model Context Protocol (MCP)4. Function Calling(函数调用)5. Retrieval-Augmented Generation (RAG)6. FineTuning&#x…...
数据结构--堆
一、堆的定义 堆是一棵完全二叉树,树中的每个结点的值都不小于(或不大于)其左右孩子结点的值。其中,如果父亲结点的值始终大于或等于孩子结点的值,那么称这样的堆为大顶堆,这时每个结点的值都是以它为根节…...
第37次CCF计算机软件能力认证 / T4 / 集体锻炼
题目 代码 #include <bits/stdc.h> using namespace std; using LL long long;const int N 1e6 10; const int mod 998244353; int a[N]; int st[N][22];int get(int l, int r) {int x r - l 1;int k log2(x);return __gcd(st[l][k], st[r - (1 << k) 1][…...
ES6规范新特性总结
ES6新特性 var、let和const不存在变量提升暂时性死区不允许重复声明 解构赋值用途:交换变量的值从函数返回多个值提取JSON数据遍历map结构输入模块的制定方法 字符串的扩展codePointAt()String.fromCharCode()at()includes(),startsWith(),endsWith()repeat()padSta…...
AI模型多阶段调用进度追踪系统设计文档
AI模型多阶段调用进度追踪系统设计文档 一、系统概述 为解决AI模型处理大型文件时响应时间长的问题,我们设计并实现了一套异步进度追踪系统。该系统采用Server-Sent Events (SSE) 技术,建立从服务器到客户端的单向实时通信通道,使前端能够实…...
[MSPM0开发]最新版ccs20.0安装、配置及导入第一个项目
一、ccs20.0 下载与安装 Code Composer Studio™ 集成式开发环境 (IDE),适用于 TI 微控制器和处理器的集成开发环境 (IDE)。它包含一整套丰富的工具,用于构建、调试、分析和优化嵌入式应用。 ccs下载地址 链接 安装比较简单,在次略过。 二、…...
Win10怎么关闭远程控制?
对于Windows 10用户来说,Win10关闭远程桌面可以有效防止不必要的远程连接,从而保护个人数据和系统安全。那么,Win10怎么关闭远程控制功能呢?接下来,我们将详细介绍Win10关闭远程控制的具体操作步骤。 步骤1.双击桌面上…...
AI重构知识生态:大模型时代的学习、创作与决策革新
📝个人主页🌹:慌ZHANG-CSDN博客 🌹🌹期待您的关注 🌹🌹 一、引言:从知识的获取到知识的共生 过去,我们对“知识”的理解,大多依赖书籍、老师、经验和专业的培训体系。而在大语言模型(Large Language Models, LLM)崛起之后,AI成为了一种新的“知识界面”:…...
牛客 小红杀怪
通过枚举所有使用y技能的次数来枚举出所有方案,选出最合适的 #include<iostream> #include<cmath> #include<algorithm> using namespace std;int a, b, x, y; int ans500;int main() {ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin>&…...
Spring入门概念 以及入门案例
Spring入门案例 Springspring是什么spring的狭义与广义spring的两个核心模块IoCAOP Spring framework特点spring入门案例不用new方法,如何使用返回创建的对象 容器:IoC控制反转依赖注入 Spring spring是什么 spring是一款主流的Java EE轻量级开源框架 …...
SpringAI调用硅基流动免费模型
一、引入Spring AI 新建一个Spring Boot的工程,在工程中引入Spring AI的依赖,Spring AI支持Ollma、类OpenAI的接口,这两个引入的pom不一样,这里示例中是使用的硅基流动的模型 <!-- Spring Boot版本要 2.x 或者 3.x以上-->…...
Java 开发中主流安全框架的详细对比,涵盖 认证、授权、加密、安全策略 等核心功能,帮助开发者根据需求选择合适的方案
以下是 Java 开发中主流安全框架的详细对比,涵盖 认证、授权、加密、安全策略 等核心功能,帮助开发者根据需求选择合适的方案: 1. 主流安全框架对比表 框架名称类型核心功能适用场景优点缺点官网/文档Spring Security企业级安全框架认证、授…...
【TVM教程】在支持 CMSIS-NN 的 Arm(R) Cortex(R)-M55 CPU 和 Ethos(TM)-U55 NPU 裸机上运行 TVM
Apache TVM是一个深度的深度学习编译框架,适用于 CPU、GPU 和各种机器学习加速芯片。更多 TVM 中文文档可访问 →https://tvm.hyper.ai/ 作者:Grant Watson 本节使用示例说明如何使用 TVM 在带有 CMSIS-NN 的 Arm Cortex-M55 CPU 和 Ethos™-U55 NPU 的…...
【Ai/Agent】Windows11中安装CrewAI过程中的错误解决记录
CrewAi是什么,可以看之下之前写的 《初识CrewAI多智能代理团队协框架》 (注:这篇是基于linux系统下安装实践的) 基于以下记录解决问题后,可以再回到之前的文章继续进行CrewAI的安装 遇到问题 在windows系统中安装 CrewAi 不管是使用 pip 或者…...
洛谷 P11962:[GESP202503 六级] 树上漫步 ← dfs + 邻接表
【题目来源】 https://www.luogu.com.cn/problem/P11962 【题目描述】 小 A 有一棵 n 个结点的树,这些结点依次以 1,2,⋯,n 标号。 小 A 想在这棵树上漫步。具体来说,小 A 会从树上的某个结点出发,每⼀步可以移动到与当前结点相邻的结点&…...
Linux shell脚本编程
什么是Shell程序设计? 也就是给计算机发命令,让它帮你做事,你通过shell 的小工具,用键盘输入指令,linux就会根据这些指令去执行任务,就像你法号一个指令一样。 shell的强大之处? 文件处理&a…...
嵌入式硬件篇---Uart和Zigbee
文章目录 前言一、UART(通用异步收发传输器)1. 基本概念2. 工作原理帧结构起始位数据位校验位停止位 异步通信波特率 3. 特点优点缺点 4. 典型应用 二、ZigBee1. 基本概念2. 技术细节工作频段2.4GHz868MHz 网络拓扑星型网络网状网络簇状网络 协议栈物理层…...
Linux Makefile-概述、语句格式、编写规则、多文件编程、Makefile变量分类:自定义变量、预定义变量
目录 1.make 1.1 make 命令格式 2.Makefile 核心概念 2.1创建并运行 Makefile步骤 3. Makefile编写 3.1最基础Makefile 3.1.1使用默认make命令 3.1.2使用make -f 命令 3.1.3 gcc编译常用组合选项 3.1.4 make 和 make all区别 3.1.4.1 all 是默认目标 3.1.4.2 al…...
Kotlin日常使用函数记录
文章目录 前言字符串集合1.两个集合的差集2.集合转数组2.1.集合转基本数据类型数组2.2.集合转对象数组 Map1.合并Map1.1.使用 操作符1.2.使用 操作符1.3.使用 putAll 方法1.4.使用 merge 函数 前言 记录一些kotlin开发中,日常使用的函数和方式之类的,…...
【JavaScript】异步编程
个人主页:Guiat 归属专栏:HTML CSS JavaScript 文章目录 1. 异步编程基础1.1 同步与异步1.1.1 同步执行1.1.2 异步执行 1.2 JavaScript 事件循环 2. 回调函数2.1 基本回调模式2.2 错误处理2.3 回调地狱 3. Promise3.1 Promise 基础3.2 Promise 链式调用3…...
批量合并多张 jpg/png 图片为长图或者 PDF 文件,支持按文件夹合并图片
我们经常会碰到需要将多张图片拼成一张图片的场景,比如将多张图片拼成九宫格图片,或者将多张图片拼成一张长图。还有可能会碰到需要将多张图片合并成一个完整的 PDF 文件来方便我们进行打印或者传输等操作。那这些将图片合并成一张图片或者一个完整的文档…...
使用docker 安装向量数据库Milvus
Miluvs 官网 www.milvus.io/ https://milvus.io/docs/zh/install_standalone-docker-compose-gpu.md 一、基本概念 向量数据库:Milvus是一款云原生向量数据库,它支持多种类型的向量,如浮点向量、二进制向量等,并且可以处理大规模…...