上一页 1 2 3 4 5 6 7 8 ··· 32 下一页
摘要: 了解Prompt template 提示模板是为大模型生成提示的预定义模版。 一个模板可能包括指令、少量示例,以及适合给定任务的特定上下文和问题。 PromptTemplate 使用 PromptTemplate 创建一个字符串提示的模板。 默认情况下,PromptTemplate使用 Python 阅读全文
posted @ 2024-12-31 16:36 王竹笙 阅读(427) 评论(0) 推荐(0)
摘要: Langchain, 框架快速入门 Django/Flask/Fastapi 当我们想要实现一个web后端服务时,我们可以选择手动使用Python来编写所有的功能,但这样做通常会非常耗时且容易出错。为了提高效率和稳定性,我们通常会选择使用像Django或Flask这样的web框架。 1. 因为它们提 阅读全文
posted @ 2024-12-31 10:41 王竹笙 阅读(230) 评论(0) 推荐(0)
摘要: 上干货,去掉没用的。用思维导图看起来更容易理解。 提示词--消息--大模型。 阅读全文
posted @ 2024-12-27 14:31 王竹笙 阅读(34) 评论(0) 推荐(0)
摘要: wsl终端使用pip安装library时弹出 This environment is externally managed ╰─> To install Python packages system-wide, try brew install xyz, where xyz is the packa 阅读全文
posted @ 2024-12-27 11:03 王竹笙 阅读(1629) 评论(0) 推荐(0)
摘要: 项目地址 项目官网: https://github.com/chatchat-space/Langchain-Chatchatwiki: https://github.com/chatchat-space/Langchain-Chatchat/wiki/ 向量数据库: Chroma。 轻量级。 根据 阅读全文
posted @ 2024-12-26 10:25 王竹笙 阅读(256) 评论(0) 推荐(0)
摘要: 为什么要给大模型连上网 人们有获取最新信息的需求减少大模型的幻觉 这里不再使用openai调用开发,使用国内的 智普AI进行开发。方便后边国产化。 SerpAPI SerpAPI是一种 Python 工具,提供 SerpAPI Google!搜索引擎结果 AP!和 SerpAP! 必应搜索引擎结果 阅读全文
posted @ 2024-12-24 18:39 王竹笙 阅读(643) 评论(0) 推荐(0)
摘要: stream api from openai import OpenAI client = OpenAI( # This is the default and can be omitted api_key="sk-T1SC0pSurmOOhsdGu3P9WnHv5pDEhaz6GeMyENMfnsu 阅读全文
posted @ 2024-12-24 18:17 王竹笙 阅读(47) 评论(0) 推荐(0)
摘要: Chat Completions AP Chat 模型将消息列表作为输入,并返回模型生成的消息作为输出-个 Chat Completions APl 调用的示例看起来如下 # penA api base地址:"https://api.openai.com/v1" # 老版本(v1以下的版本)0PEN 阅读全文
posted @ 2024-12-24 17:37 王竹笙 阅读(170) 评论(0) 推荐(0)
摘要: 非流失 import os from openai import OpenAI client = OpenAI( # This is the default and can be omitted api_key=os.environ.get("OPENAI_API_KEY"), # 获取本地变量 b 阅读全文
posted @ 2024-12-20 18:58 王竹笙 阅读(1783) 评论(1) 推荐(0)
摘要: 了解Embeddings 什么是Embeddings Embeddings(嵌入)在自然语言处理(NLP)中起着至关重要的作用,它们的主要目的是将高维、离散的文本数据(如单词或短语)转换为低维、连续的向量表示。这些向量不仅编码了词本身的含义,还捕捉到了词语之间的语义和句法关系。通过embedding 阅读全文
posted @ 2024-12-20 18:24 王竹笙 阅读(254) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 32 下一页