您现在的位置是:网站首页> AI人工智能

AI人工智能应用编程

摘要

AI人工智能应用编程

基于gradio框架开发知识收集

***Agent让调用模型变得简单***

方便调用AI模型的Agent编程框架

*本地模型部署工具部署模型,用Agent框架调用部署工具接口实现调用模型*

*LangChain Agent框架支持Python与.NET*

1.jpg

客户端将MCP工具列表和用户问题-》大语言模型-》需要调用MCP的信息返回给调用模型的客户端,客户端调用指定MCP->客户端获得MCP结果-》大语言模型-》返回给最终客户


LangChain.NET如何调用Ollama制作知识库和调用MCP服务

C# AI编程技术收集

Python AI 相关资料

本地模型部署工具有哪些

AI Agent开发相关

Agent编程视频

Dify 一个开源 LLM 应用开发平台【与coze对标】,点击查看扣子教程

喂饭教程!15分钟用Dify搭建基于智能体的聊天式数据查询应用

Stability Matrix,一款开源免费的,多平台,多模型,多WebUI的管理神器

GPT-4 All 免费开源!本地部署,无需GPU、可离线使用

简化 AI 项目管理平台AIStarter

LiblibAI客户端,内嵌哩布模型社区,集成WebUI和 ComfyUI两大启动器,简单好用的生图工具

在线手册学习资料

AI人工智能的基础知识

***Stable Diffusion API 文档***

Stable Diffusion v3.0 api使用教程

AI环境一键初始化,GitHub工程一键部署脚本

再说AI环境搭建

***打包AI项目,打包CUDA,打包CUDNN,打包TensorRT,打包FFMPEG,AI项目整合包制作***

CUDA与cuDNN如何实现复制使用

在Windows下,Python程序可以通过设置环境变量来临时指定使用特定的CUDA和cuDNN版本。

一键Python程序打包成EXE🟢通用脚本,适配Github各种AI项目

【ChatGPT+Quivr】快速部署本地AI知识库|私人定制

手把手带您三步骤轻松搞定ChatGPT模型训练,轻松拥有一个自己定制的ChatGPT模型

以对话方式快速定制自己的ChatGPT机器人

手把手教你玩Hugging Face

2023公认最通俗易懂的【HuggingFace】教程 

开源!如何把stable diffusion变成商用软件?教你正确的调用stable diffusion api!

onnxruntime AI模型调用框架

AI视频教程收集

手把手教你玩Hugging Face

LangChain 是一个为各种大型语言模型应用提供通用接口的框架

Coze与Dify知识库问答对比 | 国产AI应用开发平台扣子能遥遥领先吗

手把手教你FastGPT本地快速搭建部署




本地模型部署工具有哪些

Ollama

LM Studio



Ollama

访问Ollama主页

Ollama接口

C#调用Ollama配合向量数据库做知识库



LM Studio

访问LM Studio主页

####【豆包】

Q:LMStudio加向量数据库制作知识库的详细实现代码

A:...


####【豆包】

Q:知道LMStudio AI框架吗

A:...

Q:如何通过LMStudio 接口实现调用模型MCP服务,给出详细实现代码

A:...


LM Studio下载模型位置

1.jpg

LM Studio的接口服务及例子

1.jpg

接口例子:

hello wolrd (curl)

curl http://localhost:1234/v1/chat/completions \

  -H "Content-Type: application/json" \

  -d '{ 

    "model": "TheBloke/Mistral-7B-Instruct-v0.1-GGUF",

    "messages": [ 

      { "role": "system", "content": "Always answer in rhymes." },

      { "role": "user", "content": "Introduce yourself." }

    ], 

    "temperature": 0.7, 

    "max_tokens": -1,

    "stream": true

}'


同效果的C#调用

             XNWindowHttpClient m_XNWindowHttpClient = new XNWindowHttpClient();

            bool bOK;

            Hashtable m_HHH = new Hashtable();

            m_HHH["model"] = "TheBloke/Mistral-7B-Instruct-v0.1-GGUF";

            m_HHH["temperature"] = 0.7;

            m_HHH["max_tokens"] = 500;

            m_HHH["stream"] = false;// true;


            List<Hashtable> m_List = new List<Hashtable>();

            Hashtable m_oneHH = new Hashtable();

            m_oneHH["role"] = "system";

            m_oneHH["content"] = "Always answer in rhymes.";

            m_List.Add(m_oneHH);


            Hashtable m_one2HH = new Hashtable();

            m_one2HH["role"] = "user";

            m_one2HH["content"] = "Introduce yourself.";

            m_List.Add(m_one2HH);


            m_HHH["messages"] = m_List;


            string sText = JsonHelper.OBJToJsonStr(m_HHH);            

            string sData = m_XNWindowHttpClient.PostJson("http://localhost:1234/v1/chat/completions", sText, out bOK);

            MessageBox.Show(sData);


chat(python)

# Example: reuse your existing OpenAI setup

from openai import OpenAI


# Point to the local server

client = OpenAI(base_url="http://localhost:1234/v1", api_key="lm-studio")


completion = client.chat.completions.create(

  model="TheBloke/Mistral-7B-Instruct-v0.1-GGUF",

  messages=[

    {"role": "system", "content": "Always answer in rhymes."},

    {"role": "user", "content": "Introduce yourself."}

  ],

  temperature=0.7,

)


print(completion.choices[0].message)


ai assistant (python)

# Chat with an intelligent assistant in your terminal

from openai import OpenAI


# Point to the local server

client = OpenAI(base_url="http://localhost:1234/v1", api_key="lm-studio")


history = [

    {"role": "system", "content": "You are an intelligent assistant. You always provide well-reasoned answers that are both correct and helpful."},

    {"role": "user", "content": "Hello, introduce yourself to someone opening this program for the first time. Be concise."},

]


while True:

    completion = client.chat.completions.create(

        model="TheBloke/Mistral-7B-Instruct-v0.1-GGUF",

        messages=history,

        temperature=0.7,

        stream=True,

    )


    new_message = {"role": "assistant", "content": ""}

    

    for chunk in completion:

        if chunk.choices[0].delta.content:

            print(chunk.choices[0].delta.content, end="", flush=True)

            new_message["content"] += chunk.choices[0].delta.content


    history.append(new_message)

    

    # Uncomment to see chat history

    # import json

    # gray_color = "\033[90m"

    # reset_color = "\033[0m"

    # print(f"{gray_color}\n{'-'*20} History dump {'-'*20}\n")

    # print(json.dumps(history, indent=2))

    # print(f"\n{'-'*55}\n{reset_color}")


    print()

    history.append({"role": "user", "content": input("> ")})


vision (python)

# Adapted from OpenAI's Vision example 

from openai import OpenAI

import base64

import requests


# Point to the local server

client = OpenAI(base_url="http://localhost:1234/v1", api_key="lm-studio")


# Ask the user for a path on the filesystem:

path = input("Enter a local filepath to an image: ")


# Read the image and encode it to base64:

base64_image = ""

try:

  image = open(path.replace("'", ""), "rb").read()

  base64_image = base64.b64encode(image).decode("utf-8")

except:

  print("Couldn't read the image. Make sure the path is correct and the file exists.")

  exit()


completion = client.chat.completions.create(

  model="TheBloke/Mistral-7B-Instruct-v0.1-GGUF",

  messages=[

    {

      "role": "system",

      "content": "This is a chat between a user and an assistant. The assistant is helping the user to describe an image.",

    },

    {

      "role": "user",

      "content": [

        {"type": "text", "text": "What’s in this image?"},

        {

          "type": "image_url",

          "image_url": {

            "url": f"data:image/jpeg;base64,{base64_image}"

          },

        },

      ],

    }

  ],

  max_tokens=1000,

  stream=True

)


for chunk in completion:

  if chunk.choices[0].delta.content:

    print(chunk.choices[0].delta.content, end="", flush=True)


embeddings (python)

# Make sure to `pip install openai` first

from openai import OpenAI

client = OpenAI(base_url="http://localhost:1234/v1", api_key="lm-studio")


def get_embedding(text, model="nomic-ai/nomic-embed-text-v1.5-GGUF"):

   text = text.replace("\n", " ")

   return client.embeddings.create(input = [text], model=model).data[0].embedding


print(get_embedding("Once upon a time, there was a cat."))



Dify 一个开源 LLM 应用开发平台

点击查看源码

***第一次使用记得登录后点击头像选设置->模型供应商->配置好模型才能使用***

Dify 是一个开源 LLM 应用开发平台。Dify 的直观界面结合了 AI 工作流、RAG 管道、代理功能、模型管理、可观察性功能等,让您可以快速从原型转向生产



喂饭教程!15分钟用Dify搭建基于智能体的聊天式数据查询应用

点击在线体验



Stability Matrix,一款开源免费的,多平台,多模型,多WebUI的管理神器

点击查看原视频

点击查看源码

点击软件主页

注意设置git的代理(安装模块需要git)

设置与取消git的代理

git config --global http.proxy http://127.0.0.1:10809

git config –global –unset http.proxy



GPT-4 All 免费开源!本地部署,无需GPU、可离线使用

GPT-4 ALL 安装包+本地模型下载:https://www.freedidi.com/11195.html



简化 AI 项目管理平台AIStarter

AIStarter是一款免费的AI项目管理平台,旨在让用户能够在Windows、Mac或Linux上快速轻松地下载、安装和分享各类热门AI开源项目。

点击进入软件主页




***Stable Diffusion API 文档***

点击查看Stable Diffusion API 文档

搭建Stable Diffusion 文生图API

查看自己的SD接口文档:http://127.0.0.1:7860/docs

运行API服务:webui.bat  --nowebui

cd stable-diffusion-webui
python launch.py --nowebui --xformers --opt-split-attention --listen --port 7862


命令描述

--nowebui 以 API 模式启动。

--xformers 改善内存消耗和速度。

--opt-split-attention Cross attention layer optimization 优化显着减少了内存使用。

--listen 默认启动绑定的 IP 是 127.0.0.1。

--port 默认端口是7860,可以配置并修改该参数,例如:--port 7862。

--gradio-auth username:password如果希望给 WebUI 设置登录密码,可以配置该参数,例如:--gradio-auth GitLqr:123456。


启动 StableDiffusion API 接口使用指南

配置完成后,在浏览器地址栏输入服务器 IP 地址:端口号/docs 可查看相关的 API 接口使用指南。

官方提供的常用 API 如下:

/sdapi/v1/txt2img文字生图 POST

/sdapi/v1/img2img图片生图 POST

/sdapi/v1/options获取设置 GET | 更新设置 POST(可用来更新远端的模型)

/sdapi/v1/sd-models获取所有的模型 GET




Stable Diffusion v3.0 api使用教程

今天Stable Diffusion v3.0的api终于可以使用, 效果真的出奇的好.

我这里测试了下给予Python环境的调用, 效果也是非常的好.

第一步, 注册API Key

如果想使用Stable Diffusion v3.0的API, 就要先注册并生成一个秘钥, 网址如下:

https://platform.stability.ai/account/keys


在下面的界面中点击"Create API Key"按钮, 就会生成红色框中的API Key, 然后点击蓝色框中复制按钮, 就可以保存下来.

1.png


第二步, 运行代码

import requests


response = requests.post(

    f"https://api.stability.ai/v2beta/stable-image/generate/sd3",

    headers={

        "authorization": f"Bearer Your API Key",

        "accept": "image/*"

    },

    files={"none": ''},

    data={

        "prompt": "An blue ship with golden wings",

        "output_format": "jpeg",

    },

)


if response.status_code == 200:

    with open("./blue_ship_with_golden_wings.jpeg", 'wb') as file:

        file.write(response.content)

else:

    raise Exception(str(response.json()))



from PIL import Image


input_image = Image.open("./blue_ship_with_golden_wings.jpeg").convert("RGB")

display(input_image)

AI助手

将上面的"Your API Key"替换为你刚才生成的, 然后自定义prompt字段就可以生成你的图像



CUDA与cuDNN如何实现复制使用

CUDA和cuDNN的复制使用通常指的是将这些库从一个已经安装好的环境复制到另一个环境,以避免在新环境中重新安装。以下是实现复制使用的步骤:


确定CUDA和cuDNN的版本

首先,确保你知道源环境中CUDA和cuDNN的版本。可以通过命令行输入nvcc --version来查看CUDA版本,cuDNN版本通常不直接显示,但可以通过查看cuDNN库文件的属性来获取。


复制CUDA文件夹:

在源环境中,找到CUDA的安装目录(通常是C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vX.Y,其中X.Y是版本号)。

将整个CUDA目录复制到目标机器的相应位置。


复制cuDNN文件:

在源环境中,找到cuDNN的文件,这些通常位于CUDA目录下的bin、include和lib\x64(或相应架构目录)中。

将这些文件复制到目标机器的CUDA对应目录中。


设置环境变量

在目标机器上,设置环境变量以指向复制过来的CUDA和cuDNN目录。通常需要添加CUDA的bin目录到系统的PATH环境变量中。


验证安装:

在目标机器上打开命令行窗口,输入nvcc --version来验证CUDA Toolkit是否被正确识别。

输入nvidia-smi来检查GPU是否被系统识别,这虽然不直接验证cuDNN,但可以确保GPU驱动和CUDA Toolkit工作正常。


解决可能的兼容性问题

如果目标机器的显卡驱动与复制的CUDA版本不兼容,可能需要更新或降级显卡驱动。

确保cuDNN版本与CUDA Toolkit版本兼容。


测试深度学习框架:

如果您使用深度学习框架(如TensorFlow或PyTorch),在目标机器上安装这些框架,并确保它们能够找到并使用复制的CUDA和cuDNN。

请注意,这种方法适用于CUDA和cuDNN的某些版本,但并不保证在所有情况下都能成功,特别是如果存在版本不兼容或系统环境差异时。如果可能,建议在每个目标机器上进行干净的安装,以避免潜在的问题。



在Windows下,Python程序可以通过设置环境变量来临时指定使用特定的CUDA和cuDNN版本。

在Windows下,Python程序可以通过设置环境变量来临时指定使用特定的CUDA和cuDNN版本。以下是一些步骤和方法:


设置CUDA环境变量:

打开命令行工具(如CMD或PowerShell)。

临时设置环境变量,可以通过以下命令来指定CUDA的路径:

shell

set CUDA_HOME=C:\path\to\your\cuda

set PATH=%CUDA_HOME%\bin;%PATH%

将C:\path\to\your\cuda替换为实际的CUDA安装目录。


设置cuDNN环境变量:

同样在命令行中,设置cuDNN的环境变量:

shell

set CUDNN_PATH=C:\path\to\your\cudnn

set PATH=%CUDNN_PATH%\bin;%PATH%

将C:\path\to\your\cudnn替换为实际的cuDNN解压目录。


使用Python环境:

在同一命令行窗口中,激活你的Python环境(如果使用虚拟环境):

shell

.\path\to\your\venv\Scripts\activate

替换path\to\your\venv为你的Python虚拟环境路径。


安装或使用深度学习框架:

确保你的深度学习框架(如TensorFlow或PyTorch)已经安装在当前激活的环境中,并且它们将使用新设置的环境变量。


运行Python脚本

运行你的Python脚本或程序,它将使用指定的CUDA和cuDNN版本。


临时性:

请注意,这些环境变量的设置是临时的,只对当前打开的命令行窗口有效。一旦关闭窗口,设置将不再有效。


使用深度学习框架的API:

某些深度学习框架允许你通过代码来指定CUDA和cuDNN。例如,在TensorFlow中,你可以在程序开始时设置:

python

import os

os.environ['CUDA_HOME'] = 'C:\\path\\to\\your\\cuda'

os.environ['PATH'] += ';C:\\path\\to\\your\\cuda\\bin'

这种方法可以在Python脚本中直接设置环境变量。


通过上述步骤,你可以在Windows下临时指定Python程序使用的CUDA和cuDNN版本。这对于测试不同版本的CUDA和cuDNN或在没有管理员权限的情况下进行开发非常有用。







【ChatGPT+Quivr】快速部署本地AI知识库|私人定制





手把手带您三步骤轻松搞定ChatGPT模型训练,轻松拥有一个自己定制的ChatGPT模型


手把手带您三步骤轻松搞定ChatGPT模型训练,轻松拥有一个自己定制的ChatGPT模型。


ChatGPT模型训练介绍:

https://platform.openai.com/docs/guides/fine-tuning


数据格式说明:

https://platform.openai.com/docs/api-...


测试代码:

---

how to fine-tune ChatGPT mode

import os

import openai

def set_api_key():

    set you openapi key

    openai.api_key = "sk-YOUR-OPENAI-KEY-HERE"

def dataset_upload():

    set_api_key()

    result = openai.File.create(

        file=open("path-to-your-local/dataset.jsonl", "rb"),

        purpose='fine-tune'

    )

    print(result)


def tune_now(uploaded_file_id):

    set_api_key()

    result = openai.FineTuningJob.create(training_file=uploaded_file_id, model="gpt-3.5-turbo")

    print(result)


def chat_with_yx_model(model_id):

    set_api_key()

    completion = openai.ChatCompletion.create(

        model=model_id,

        messages=[

            {"role": "system",

             "content": "Marv is mental healthy expert"},

            {"role": "user", "content": "Who does mental illness affect?"}

        ]

    )

    print(completion)


main

if _name_ == '__main__':

    step 1 : upload training dataset

    dataset_upload()


    step 2 : begin fine-tune ChatGPT model

    tune_now("file-B9UjNJwHqVU1cBu1mZraLw1q")


    step 3 : use my trained model

    chat_with_yx_model("ft:gpt-3.5-turbo-0613:personal::84NbaCOS" )


---



训练数据样例:

如下数据保存到你本地命名为:dataset.jsonl

---

{"messages": [{"role": "system", "content": "Marv is mental healthy expert"}, {"role": "user", "content": "What does it mean to have a mental illness?"}, {"role": "assistant", "content": "Mental illnesses fall along a continuum of severity: some are fairly mild and only interfere with some aspects of life, such as certain phobias."}]}

{"messages": [{"role": "system", "content": "Marv is mental healthy expert"}, {"role": "user", "content": "Who does mental illness affect?"}, {"role": "assistant", "content": "It is estimated that mental illness affects 1 in 5 adults in America, and that 1 in 24 adults have a serious mental illness. "}]}

{"messages": [{"role": "system", "content": "Marv is mental healthy expert"}, {"role": "user", "content": "What causes mental illness?"},{"role": "assistant", "content": "Symptoms of mental health disorders vary depending on the type and severity of the condition. "}]}

{"messages": [{"role": "system", "content": "Marv is mental healthy expert"}, {"role": "user", "content": "What are some of the warning signs of mental illness?"},{"role": "assistant", "content": "When healing from mental illness, early identification and treatment are of vital importance. Based on the nature of the illness, there are a range of effective treatments available. For any type of treatment, it is essential that the person affected is proactive and fully engaged in their own recovery process."}]}

{"messages": [{"role": "system", "content": "Marv is mental healthy expert"}, {"role": "user", "content": "Can people with mental illness recover?"},{"role": "assistant", "content": "Vaping is the term for using a device where liquids, often flavoured, are turned into vapour (hence, vaping) and inhaled. A vaping device consists of a mouthpiece, tank or reservoir to hold the liquid, a heating element and a battery to power the element. "}]}

{"messages": [{"role": "system", "content": "Marv is mental healthy expert"}, {"role": "user", "content": "What should I do if I know someone who appears to have the symptoms of a mental disorder?"},{"role": "assistant", "content": "It’s much more than sadness or low mood. People who experience depression may feel worthless or hopeless. They may feel unreasonable guilty. Some people may experience depression as anger or irritability."}]}

{"messages": [{"role": "system", "content": "Marv is mental healthy expert"}, {"role": "user", "content": "How can I find a mental health professional for myself or my child?"},{"role": "assistant", "content": "Dysthymia, now called persistent depressive disorder or PDD, is a mood disorder. It is related depression (major depressive disorder). The difference between the two is in the number of symptoms and the amount of time that they last. S"}]}

{"messages": [{"role": "system", "content": "Marv is mental healthy expert"}, {"role": "user", "content": "What treatment options are available?"},{"role": "assistant", "content": "Cyclothymic disorder is a subtype of bipolar disorder. Much like bipolar disorder, the symptoms of cyclothymia include three or more symptoms of hypomania, and five or more symptoms of depression."}]}

{"messages": [{"role": "system", "content": "Marv is mental healthy expert"}, {"role": "user", "content": "If I become involved in treatment, what do I need to know?"},{"role": "assistant", "content": "Rapid cycling means that someone diagnosed with bipolar disorder (or depression) experiences four or more episodes of depression and/or mania in one year. "}]}



2023公认最通俗易懂的【HuggingFace】教程 

 点击查看原视频



开源!如何把stable diffusion变成商用软件?教你正确的调用stable diffusion api!


sdwebui-api-manager: https://github.com/nftblackmagic/sdwebui-api-manager


sd-webui-hook-v2: https://github.com/nftblackmagic/sd-webui-hook-v2


stable diffusion webui: https://github.com/AUTOMATIC1111/stable-diffusion-webui



一键Python程序打包成EXE🟢通用脚本,适配Github各种AI项目


本视频文字资源:https://niugee.com/python2exe/

在本视频中,我们将展示如何使用Python脚本将程序打包成EXE文件。这是一个通用的脚本,可以适配各种Github上的AI项目。无论您是初学者还是有经验的开发者,这个教程都会帮助您轻松地将Python程序打包成独立的可执行文件。欢迎来到牛哥AI实验室(NIUGEE AI),让我们一起来探索更多的AI项目吧!


为什么这么做?

打包Python程序为EXE文件的主要好处是可以方便地分享程序,不需要用户安装Python,并且可以自定义图标和保护代码。


用什么打包?

PyInstaller:最常用,支持生成单个文件和窗口应用程序。


安装:pip install pyinstaller

打包:pyinstaller --onefile your_script.py

cx_Freeze:适合复杂项目。


安装:pip install cx_Freeze

编写 setup.py

打包:python setup.py build

Py2exe:适合简单项目,仅支持Windows。


安装:pip install py2exe

编写 setup.py

打包:python setup.py py2exe

Nuitka:适合需要性能优化的项目,将Python代码编译为C++代码。


安装:pip install nuitka

编译:nuitka --follow-imports --standalone your_script.py

总结

选择合适的打包工具根据项目需求和个人偏好决定。每种工具都有其独特的优势。


如何打包?

安装PyInstaller:pip install pyinstaller

使用PyInstaller打包:pyinstaller your_script.py

为什么有错误,怎么办?

Gradio UI 需要手动添加Gradio模块。


修改spec文件,添加:module_collection_mode={'gradio':'py',}

参数调用错误:


确保代码中的路径和参数配置正确。

缺少资源:


检查资源文件是否在正确位置,确保路径和配置正确。



onnxruntime AI模型调用框架

1.pnghttps://github.com/microsoft/onnxruntime



LangChain 是一个为各种大型语言模型应用提供通用接口的框架

点击查看源码

1.png

理解 Agent 和 Chain

Chain

在 LangChain 中,Chain 是指一系列按顺序执行的任务或操作,这些任务通常涉及与语言模型的交互。Chain 可以看作是处理输入、执行一系列决策和操作,最终产生输出的流程。Chain 的复杂性可以从简单的单一提示(prompt)和语言模型调用,扩展到涉及多个步骤和决策点的复杂流程。


Agent

Agent 是 LangChain 中更为高级和自主的实体,负责管理和执行 Chain。Agent 可以决定何时、如何以及以何种顺序执行 Chain 中的各个步骤。通常,Agent 基于一组规则或策略来模拟决策过程,能够观察执行结果并根据这些结果调整后续行动。Agent 的引入使得 LangChain 能够构建更为复杂和动态的应用程序,如自动化聊天机器人或个性化问答系统。


示例

Agent:基于某模型实现的问答系统可以视为一个 Agent。

Chain:问答系统根据一个 prompt 给出回答的过程可以看作是一个 Chain,实际回答过程通常涉及多个任务(Chain)依次执行。


简单顺序链示例

from langchain import Chain, Agent


# 定义一个简单的 Chain

simple_chain = Chain([

    {"task": "获取用户输入"},

    {"task": "处理输入"},

    {"task": "生成回答"}

])


# 定义一个 Agent

simple_agent = Agent(chain=simple_chain)


# 执行 Agent

response = simple_agent.execute()

print(response)



Coze与Dify知识库问答对比 | 国产AI应用开发平台扣子能遥遥领先吗

https://github.com/langgenius/dify

https://dify.ai/zh

点击进入国外扣子平台

点击进入国内平台

查看扣子相关教程



手把手教你FastGPT本地快速搭建部署

点击进入源码地址

查看文档




AI Agent开发相关

AI Agent全套教学

5个顶级Agent框架




AI Agent全套教学

点击查看原视频



5个顶级Agent框架

AI Agent是自主程序,旨在感知其环境并采取行动以实现特定目标。

crewAI、AutoGen、LangChain、Vertex AI Agent Builder、Cogniflow

一、crewAI

crewAI 是一个创新的开源框架,旨在促进复杂的多代理人工智能系统的创建。

主要特点:

• 基于角色的代理设计,具有可定制的目标和背景故事

• 灵活的记忆系统(短期、长期和共享)

• 可扩展的工具框架

• 系列、并行或分层的多代理协作

• 内置的防护栏和错误处理

crewAI 在 GitHub 上提供免费的开源版本


二、AutoGen

AutoGen,由微软开发,是一个开源框架,正在推动企业环境中AI代理所能实现的边界。

主要特点:

• 用于复杂问题解决的多代理架构

• 可定制和可对话的代理

• 与各种大型语言模型(LLMs)无缝集成

• 代码生成和执行能力

• 灵活的人在环功能

AutoGen 是一个开源框架,可以在 GitHub 上免费使用


三、LangChain

LangChain 是一个功能丰富的框架,简化了由语言模型驱动的应用程序构建过程。

主要特点:

• 模块化和可扩展的架构

• 统一接口,适用于多个LLM提供商

• 丰富的预构建组件(提示,解析器,向量存储)

• 用于复杂任务执行的代理功能

• 用于维护上下文的复杂内存管理

LangChain 可能更适合于小到中等规模的应用,而不是没有经过精心设计和测试的大型企业解决方案。


四、Vertex AI Agent Builder

Vertex AI Agent Builder,谷歌云的产品,提供了一个强大的平台,可以创建企业级的生成式人工智能应用,无需深度机器学习专业知识。

主要特点:

• 无代码控制台,用于快速开发代理

• 高级框架支持(例如 LangChain),用于复杂用例

• 与谷歌的基础模型和搜索能力集成

• 企业数据基础,用于准确和上下文相关的响应

• 函数调用和预构建扩展模块

• 企业级安全性和合规特性


五、Cogniflow

Cogniflow提供了一个无代码AI平台,使AI开发民主化,允许用户在不需要编码专业知识的情况下构建和部署AI模型。

主要特点:

• 直观的拖放界面用于模型构建

• 支持各种数据类型(文本、图像、音频、视频)

• 预训练模型市场,适用于常见用例

• 与流行的商业应用程序无缝集成

• 协作和共享功能

Cogniflow 似乎非常适合小到中等规模的 AI 项目和许多常见的企业 AI 场景。更大或更复杂的部署可能需要定制的企业解决方案。


需要考虑的因素

1.技术专长:评估您团队的人工智能和编码能力。像 Cogniflow 和 Vertex AI Agent Builder 这样的平台提供了无代码选项,而 AutoGen 和 LangChain 可能需要更多的技术专长。

2.使用案例复杂性:考虑您打算的人工智能应用的复杂性。对于多代理系统,AutoGen 或 crewAI 可能更合适,而更简单的用例可能适合于 Cogniflow。

3.集成需求:评估平台与您现有基础设施和数据源的集成情况。例如,Vertex AI Agent Builder 提供了强大的企业集成能力。

4.可扩展性:考虑您当前的需求和未来的增长。确保平台能够处理不断增加的工作负载和不断扩大的用例。

5.定制需求:如果您需要高度专业化的人工智能代理,像 LangChain 或 crewAI 这样的平台提供了广泛的定制选项。

6.安全性和合规性:对于有严格监管要求的行业,考虑具有强大安全功能的平台,比如 Vertex AI Agent Builder。










   


   


   


   


   

Top