1、获取工作区

/v1/workspaces   GET请求

获取内容如下

{
  "workspaces": [
    {
      "id": 1,
      "name": "test222",
      "slug": "test222",
      "vectorTag": null,
      "createdAt": "2025-02-28T04:26:16.819Z",
      "openAiTemp": 0.7,
      "openAiHistory": 20,
      "lastUpdatedAt": "2025-02-28T04:26:16.819Z",
      "openAiPrompt": "Given the following conversation, relevant context, and a follow up question, reply with an answer to the current question the user is asking. Return only your response to the question given the above information following the users instructions as needed.",
      "similarityThreshold": 0.25,
      "chatProvider": "ollama",
      "chatModel": "deepseek-r1:32b",
      "topN": 4,
      "chatMode": "chat",
      "pfpFilename": null,
      "agentProvider": null,
      "agentModel": null,
      "queryRefusalResponse": "There is no relevant information in this workspace to answer your query.",
      "vectorSearchMode": "default",
      "threads": []
    },
    {
      "id": 2,
      "name": "test01",
      "slug": "test01",
      "vectorTag": null,
      "createdAt": "2025-02-28T05:42:38.855Z",
      "openAiTemp": 0.7,
      "openAiHistory": 20,
      "lastUpdatedAt": "2025-02-28T05:42:38.855Z",
      "openAiPrompt": "Given the following conversation, relevant context, and a follow up question, reply with an answer to the current question the user is asking. Return only your response to the question given the above information following the users instructions as needed.",
      "similarityThreshold": 0.25,
      "chatProvider": "ollama",
      "chatModel": "deepseek-r1:32b",
      "topN": 4,
      "chatMode": "query",
      "pfpFilename": null,
      "agentProvider": null,
      "agentModel": null,
      "queryRefusalResponse": "There is no relevant information in this workspace to answer your query.",
      "vectorSearchMode": "default",
      "threads": []
    }
  ]
}

聊天提示(即提示词)

将在此工作区上使用的提示。定义 AI 生成响应的上下文和指令。您应该提供精心设计的提示,以便人工智能可以生成相关且准确的响应。

对应字段 openAiPrompt

查询模式拒绝响应

当处于 查询 模式时,当未找到上下文时,您可能希望返回自定义拒绝响应。

对应字段  queryRefusalResponse

LLM 温度

此设置控制您的 LLM 回答的“创意”程度
数字越高越有创意。对于某些模型,如果设置得太高,可能会导致响应不一致。

大多数 LLM 都有各种可接受的有效值范围。请咨询您的LLM提供商以获取该信息。

对应字段 openAiTemp

聊天历史记录

将包含在响应的短期记忆中的先前聊天的数量。 推荐 20。 任何超过 45 的值都可能导致连续聊天失败,具体取决于消息大小。

对应字段  openAiHistory

chatMode 为chat 或query

向量库配置 

文档相似性阈值

源被视为与聊天相关所需的最低相似度分数。数字越高,来源与聊天就越相似。

对应字段

similarityThreshold  

最大上下文片段

此设置控制每次聊天或查询将发送到 LLM 的上下文片段的最大数量。
推荐: 4

对应字段

topN

2、更新工作空间配置  接口  /v1/workspace/{slug}/update  PSOT请求

传参如下

{
      "id": 1,
      "name": "test222",
      "slug": "test222",
      "vectorTag": null,
      "createdAt": "2025-02-28T04:26:16.819Z",
      "openAiTemp": 0.7,
      "openAiHistory": 20,
      "lastUpdatedAt": "2025-02-28T04:26:16.819Z",
      "openAiPrompt": "你是一个专业助手",
      "similarityThreshold": 0.25,
      "chatProvider": "ollama",
      "chatModel": "deepseek-r1:32b",
      "topN": 4,
      "chatMode": "chat",
      "pfpFilename": null,
      "agentProvider": null,
      "agentModel": null,
      "queryRefusalResponse": "不回答.",
      "vectorSearchMode": "default",
      "threads": []
    }

更新后如下

3、创建工作空间  /v1/workspace/new  

传参如下 name 和slug如果有大写的 貌似删除不了

{
 
      "name": "newwork1",
      "slug": "newwork1",
      "openAiTemp": 0.7,
      "openAiHistory": 20,
      "openAiPrompt": "你是一个专业助手",
      "similarityThreshold": 0.25,
      "chatProvider": "ollama",
      "chatModel": "deepseek-r1:32b",
      "topN": 4,
      "chatMode": "chat",
      "queryRefusalResponse": "不回答."
 
    }

4、删除工作空间  DELETE请求

/v1/workspace/{slug}

deepseek提示库

Prompt Library | DeepSeek API Docs

Logo

GitCode 天启AI是一款由 GitCode 团队打造的智能助手,基于先进的LLM(大语言模型)与多智能体 Agent 技术构建,致力于为用户提供高效、智能、多模态的创作与开发支持。它不仅支持自然语言对话,还具备处理文件、生成 PPT、撰写分析报告、开发 Web 应用等多项能力,真正做到“一句话,让 Al帮你完成复杂任务”。

更多推荐