当前位置: 首页 > news >正文

LangChain Demo | Agent X ReAct X wikipedia 询问《三体》的主要内容

背景

LangChain学习中,尝试改了一下哈里森和吴恩达课程当中的问题,看看gpt-3.5-turbo在集成了ReAct和wikipedia后,如何回答《三体》的主要内容是什么这个问题,当然,主要是为了回答这问题时LangChain内部发生了什么。所以将langchain.debug 设置为 True。

代码出奇简洁👇

代码

import sys
import os# 添加 parent_dir 到 sys.path
current_dir = os.path.dirname(__file__)
parent_dir = os.path.dirname(current_dir)
sys.path.append(parent_dir)from constants import PROXY_URL,KEYimport warnings
warnings.filterwarnings("ignore")import langchain
langchain.debug = Truefrom langchain.agents import load_tools, initialize_agent
from langchain.agents import AgentType
from langchain.python import PythonREPL
from langchain.chat_models import ChatOpenAIllm = ChatOpenAI(temperature=0.0,model_name="gpt-3.5-turbo", openai_api_key=KEY,openai_api_base=PROXY_URL
)tools = load_tools(["wikipedia"],llm=llm
)agent= initialize_agent(tools, #第二步加载的工具llm, #第一步初始化的模型agent=AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION,  #代理类型handle_parsing_errors=True, #处理解析错误verbose = True #输出中间步骤
)response = agent("What is the main content of the science fiction novel The Three-Body Problem?")print(response)

输出异常繁琐👇

控制台输出

[chain/start] [1:chain:AgentExecutor] Entering Chain run with input:      
{
  "input": "What is the main content of the science fiction novel The Three-Body Problem?"
}
[chain/start] [1:chain:AgentExecutor > 2:chain:LLMChain] Entering Chain run with input:
{
  "input": "What is the main content of the science fiction novel The Three-Body Problem?",
  "agent_scratchpad": "",
  "stop": [
    "Observation:"
  ]
}
[llm/start] [1:chain:AgentExecutor > 2:chain:LLMChain > 3:llm:ChatOpenAI] 
Entering LLM run with input:
{
  "prompts": [
    "System: Answer the following questions as best you can. You have access to the following tools:\n\nwikipedia: A wrapper around Wikipedia. Useful for when you need to answer general questions about people, places, companies, facts, historical events, or other subjects. Input should be a search query.\n\nThe way you use the tools is by specifying a json blob.\nSpecifically, this json should have a `action` key (with the name of the tool 
to use) and a `action_input` key (with the input to the tool going here).\n\nThe only values that should be in the \"action\" field are: wikipedia\n\nThe $JSON_BLOB should only contain a SINGLE action, do NOT return a list of multiple actions. Here is an example of a valid $JSON_BLOB:\n\n```\n{\n  \"action\": $TOOL_NAME,\n  \"action_input\": $INPUT\n}\n```\n\nALWAYS use the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction:\n```\n$JSON_BLOB\n```\nObservation: the result of the action\n... (this Thought/Action/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question\n\nBegin! Reminder to always use the exact characters `Final Answer` when responding.\nHuman: What is the main content of the science fiction novel The Three-Body Problem?"
  ]
}
[llm/end] [1:chain:AgentExecutor > 2:chain:LLMChain > 3:llm:ChatOpenAI] [3.96s] Exiting LLM run with output:
{
  "generations": [
    [
      {
        "text": "Thought: I can use Wikipedia to find information about the main content of the science fiction novel \"The Three-Body Problem\".\n\nAction:\n```\n{\n  \"action\": \"wikipedia\",\n  \"action_input\": \"The 
Three-Body Problem (novel)\"\n}\n```",
        "generation_info": {
          "finish_reason": "stop",
          "logprobs": null
        },
        "type": "ChatGeneration",
        "message": {
          "lc": 1,
          "type": "constructor",
          "id": [
            "langchain",
            "schema",
            "messages",
            "AIMessage"
          ],
          "kwargs": {
            "content": "Thought: I can use Wikipedia to find information about the main content of the science fiction novel \"The Three-Body Problem\".\n\nAction:\n```\n{\n  \"action\": \"wikipedia\",\n  \"action_input\": \"The Three-Body Problem (novel)\"\n}\n```",
            "additional_kwargs": {}
          }
        }
      }
    ]
  ],
  "llm_output": {
    "token_usage": {
      "completion_tokens": 55,
      "prompt_tokens": 306,
      "total_tokens": 361
    },
    "model_name": "gpt-3.5-turbo",
    "system_fingerprint": "fp_3bc1b5746c"
  },
  "run": null
}
[chain/end] [1:chain:AgentExecutor > 2:chain:LLMChain] [3.96s] Exiting Chain run with output:
{
  "text": "Thought: I can use Wikipedia to find information about the main content of the science fiction novel \"The Three-Body Problem\".\n\nAction:\n```\n{\n  \"action\": \"wikipedia\",\n  \"action_input\": \"The Three-Body Problem (novel)\"\n}\n```"
}
[tool/start] [1:chain:AgentExecutor > 4:tool:wikipedia] Entering Tool run 
with input:
"The Three-Body Problem (novel)"
[tool/end] [1:chain:AgentExecutor > 4:tool:wikipedia] [5.47s] Exiting Tool run with output:
"Page: The Three-Body Problem (novel)
Summary: The Three-Body Problem (Chinese: 三体; lit. 'Three-Body') is a story by Chinese science fiction author Liu Cixin, the first novel in the Remembrance of Earth's Past trilogy. The series portrays a fictional past, present and future wherein Earth encounters an alien civilization from a nearby system of three sun-like stars orbiting one another, a representative example of the three-body problem in orbital mechanics.
The story was originally serialized in Science Fiction World in 2006 before it was published as a standalone book in 2008. In 2006, it received the 
Galaxy Award for Chinese science fiction. In 2012, it was described as one of China's most successful full-length novels of the past two decades. The English translation by Ken Liu was published by Tor Books in 2014. That 
translation was the first novel by an Asian writer to win a Hugo Award for Best Novel; it was also nominated for the Nebula Award for Best Novel.The book has been adapted into other media. In 2015, a Chinese film adaptation of the same name was in production, but it was never released. A Chinese TV series, Three-Body, released in early 2023 to critical success locally. An English language Netflix series, 3 Body Problem, was released in March 2024.

Page: Three-body problem
Summary: In physics and classical mechanics, the three-body problem is the problem of taking the initial positions and velocities (or momenta) of three point masses and solving for their subsequent motion according to Newton's laws of motion and Newton's law of universal gravitation. The three-body problem is a special case of the n-body problem. Unlike two-body problems, no general closed-form solution exists, as the resulting dynamical system is chaotic for most initial conditions, and numerical methods are generally required.
Historically, the first specific three-body problem to receive extended study was the one involving the Moon, Earth, and the Sun. In an extended modern sense, a three-body problem is any problem in classical mechanics or quantum mechanics that models the motion of three particles.

Page: 3 Body Problem (TV series)
Summary: 3 Body Problem is an American science fiction television series created by David Benioff, D. B. Weiss and Alexander Woo, loosely based on the Hugo Award-winning Chinese novel The Three-Body Problem by Liu Cixin. It is the second live-action adaptation after the 2023 Chinese television series.
The series premiered on Netflix with its eight episodes on March 21, 2024."
[chain/start] [1:chain:AgentExecutor > 5:chain:LLMChain] Entering Chain run with input:
{
  "input": "What is the main content of the science fiction novel The Three-Body Problem?",
  "agent_scratchpad": "This was your previous work (but I haven't seen any of it! I only see what you return as final answer):\nThought: I can use Wikipedia to find information about the main content of the science fiction novel \"The Three-Body Problem\".\n\nAction:\n```\n{\n  \"action\": \"wikipedia\",\n  \"action_input\": \"The Three-Body Problem (novel)\"\n}\n```\nObservation: Page: The Three-Body Problem (novel)\nSummary: The Three-Body Problem (Chinese: 三体; lit. 'Three-Body') is a story by Chinese science fiction author Liu Cixin, the first novel in the Remembrance of Earth's Past trilogy. The series portrays a fictional past, present and future wherein Earth encounters an alien civilization from a nearby system of three sun-like stars orbiting one another, a representative example of the three-body problem in orbital mechanics.\nThe story was originally serialized in Science Fiction World in 2006 before it was published as a standalone book in 2008. In 2006, it received the Galaxy Award for Chinese science fiction. In 2012, it was described as one of China's most successful full-length novels of the past two decades. The English translation by Ken Liu was published by Tor Books in 2014. That translation was the first novel by an 
Asian writer to win a Hugo Award for Best Novel; it was also nominated for the Nebula Award for Best Novel.The book has been adapted into other media. In 2015, a Chinese film adaptation of the same name was in production, 
but it was never released. A Chinese TV series, Three-Body, released in early 2023 to critical success locally. An English language Netflix series, 
3 Body Problem, was released in March 2024.\n\nPage: Three-body problem\nSummary: In physics and classical mechanics, the three-body problem is the 
problem of taking the initial positions and velocities (or momenta) of three point masses and solving for their subsequent motion according to Newton's laws of motion and Newton's law of universal gravitation. The three-body problem is a special case of the n-body problem. Unlike two-body problems, no general closed-form solution exists, as the resulting dynamical system is chaotic for most initial conditions, and numerical methods are generally required.\nHistorically, the first specific three-body problem to receive extended study was the one involving the Moon, Earth, and the Sun. In an extended modern sense, a three-body problem is any problem in classical mechanics or quantum mechanics that models the motion of three particles.\n\n\n\nPage: 3 Body Problem (TV series)\nSummary: 3 Body Problem is an 
American science fiction television series created by David Benioff, D. B. Weiss and Alexander Woo, loosely based on the Hugo Award-winning Chinese 
novel The Three-Body Problem by Liu Cixin. It is the second live-action adaptation after the 2023 Chinese television series.\nThe series premiered on Netflix with its eight episodes on March 21, 2024.\n\n\nThought:",      
  "stop": [
    "Observation:"
  ]
}
[llm/start] [1:chain:AgentExecutor > 5:chain:LLMChain > 6:llm:ChatOpenAI] 
Entering LLM run with input:
{
  "prompts": [
    "System: Answer the following questions as best you can. You have access to the following tools:\n\nwikipedia: A wrapper around Wikipedia. Useful for when you need to answer general questions about people, places, companies, facts, historical events, or other subjects. Input should be a search query.\n\nThe way you use the tools is by specifying a json blob.\nSpecifically, this json should have a `action` key (with the name of the tool 
to use) and a `action_input` key (with the input to the tool going here).\n\nThe only values that should be in the \"action\" field are: wikipedia\n\nThe $JSON_BLOB should only contain a SINGLE action, do NOT return a list of multiple actions. Here is an example of a valid $JSON_BLOB:\n\n```\n{\n  \"action\": $TOOL_NAME,\n  \"action_input\": $INPUT\n}\n```\n\nALWAYS use the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction:\n```\n$JSON_BLOB\n```\nObservation: the result of the action\n... (this Thought/Action/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question\n\nBegin! Reminder to always use the exact characters `Final Answer` when responding.\nHuman: What is the main content of the science fiction novel The Three-Body Problem?\n\nThis was your previous work (but I haven't seen any of it! I only see what you return as final answer):\nThought: I can use Wikipedia to find information about the main content of the science fiction novel \"The 
Three-Body Problem\".\n\nAction:\n```\n{\n  \"action\": \"wikipedia\",\n  
\"action_input\": \"The Three-Body Problem (novel)\"\n}\n```\nObservation: Page: The Three-Body Problem (novel)\nSummary: The Three-Body Problem (Chinese: 三体; lit. 'Three-Body') is a story by Chinese science fiction author Liu Cixin, the first novel in the Remembrance of Earth's Past trilogy. 
The series portrays a fictional past, present and future wherein Earth encounters an alien civilization from a nearby system of three sun-like stars orbiting one another, a representative example of the three-body problem 
in orbital mechanics.\nThe story was originally serialized in Science Fiction World in 2006 before it was published as a standalone book in 2008. In 2006, it received the Galaxy Award for Chinese science fiction. In 2012, 
it was described as one of China's most successful full-length novels of the past two decades. The English translation by Ken Liu was published by Tor Books in 2014. That translation was the first novel by an Asian writer 
to win a Hugo Award for Best Novel; it was also nominated for the Nebula Award for Best Novel.The book has been adapted into other media. In 2015, a Chinese film adaptation of the same name was in production, but it was never released. A Chinese TV series, Three-Body, released in early 2023 to critical success locally. An English language Netflix series, 3 Body Problem, was released in March 2024.\n\nPage: Three-body problem\nSummary: In physics and classical mechanics, the three-body problem is the problem of taking the initial positions and velocities (or momenta) of three point masses and solving for their subsequent motion according to Newton's laws of motion and Newton's law of universal gravitation. The three-body problem is a special case of the n-body problem. Unlike two-body problems, no general closed-form solution exists, as the resulting dynamical system is chaotic for most initial conditions, and numerical methods are generally required.\nHistorically, the first specific three-body problem to receive extended study was the one involving the Moon, Earth, and the Sun. In an extended modern sense, a three-body problem is any problem in classical mechanics 
or quantum mechanics that models the motion of three particles.\n\n\n\nPage: 3 Body Problem (TV series)\nSummary: 3 Body Problem is an American science fiction television series created by David Benioff, D. B. Weiss and Alexander Woo, loosely based on the Hugo Award-winning Chinese novel The Three-Body Problem by Liu Cixin. It is the second live-action adaptation after the 2023 Chinese television series.\nThe series premiered on Netflix with its eight episodes on March 21, 2024.\n\n\nThought:"
  ]
}
[llm/end] [1:chain:AgentExecutor > 5:chain:LLMChain > 6:llm:ChatOpenAI] [4.10s] Exiting LLM run with output:
{
  "generations": [
    [
      {
        "text": "I have found information about the main content of the science fiction novel \"The Three-Body Problem\" by Liu Cixin. It is a story that portrays a fictional past, present, and future where Earth encounters an alien civilization from a nearby system of three sun-like stars orbiting one another. The novel is the first in the Remembrance of Earth's Past trilogy and has received critical acclaim.\n\nFinal Answer: The main content of the science fiction novel \"The Three-Body Problem\" involves Earth encountering an alien civilization from a nearby system of three sun-like stars.",
        "generation_info": {
          "finish_reason": "stop",
          "logprobs": null
        },
        "type": "ChatGeneration",
        "message": {
          "lc": 1,
          "type": "constructor",
          "id": [
            "langchain",
            "schema",
            "messages",
            "AIMessage"
          ],
          "kwargs": {
            "content": "I have found information about the main content of the science fiction novel \"The Three-Body Problem\" by Liu Cixin. It is 
a story that portrays a fictional past, present, and future where Earth encounters an alien civilization from a nearby system of three sun-like stars orbiting one another. The novel is the first in the Remembrance of Earth's Past trilogy and has received critical acclaim.\n\nFinal Answer: The main content of the science fiction novel \"The Three-Body Problem\" involves Earth encountering an alien civilization from a nearby system of three sun-like stars.",
            "additional_kwargs": {}
          }
        }
      }
    ]
  ],
  "llm_output": {
    "token_usage": {
      "completion_tokens": 113,
      "prompt_tokens": 924,
      "total_tokens": 1037
    },
    "model_name": "gpt-3.5-turbo",
    "system_fingerprint": "fp_3bc1b5746c"
  },
  "run": null
}
[chain/end] [1:chain:AgentExecutor > 5:chain:LLMChain] [4.10s] Exiting Chain run with output:
{
  "text": "I have found information about the main content of the science 
fiction novel \"The Three-Body Problem\" by Liu Cixin. It is a story that 
portrays a fictional past, present, and future where Earth encounters an alien civilization from a nearby system of three sun-like stars orbiting one another. The novel is the first in the Remembrance of Earth's Past trilogy and has received critical acclaim.\n\nFinal Answer: The main content of the science fiction novel \"The Three-Body Problem\" involves Earth encountering an alien civilization from a nearby system of three sun-like stars."
}
[chain/end] [1:chain:AgentExecutor] [13.57s] Exiting Chain run with output:
{
  "output": "The main content of the science fiction novel \"The Three-Body Problem\" involves Earth encountering an alien civilization from a nearby system of three sun-like stars."
}
{'input': 'What is the main content of the science fiction novel The Three-Body Problem?', 'output': 'The main content of the science fiction novel 
"The Three-Body Problem" involves Earth encountering an alien civilization from a nearby system of three sun-like stars.'}

最终结果

The Three-Body Problem" involves Earth encountering an alien civilization from a nearby system of three sun-like stars. 

翻译:《三体问题》涉及地球遇到来自附近三颗类太阳恒星系统的外星文明。

 

相关文章:

LangChain Demo | Agent X ReAct X wikipedia 询问《三体》的主要内容

背景 LangChain学习中,尝试改了一下哈里森和吴恩达课程当中的问题,看看gpt-3.5-turbo在集成了ReAct和wikipedia后,如何回答《三体》的主要内容是什么这个问题,当然,主要是为了回答这问题时LangChain内部发生了什么。所…...

Revit 2025新功能一览~

Hello大家好!我是九哥~ Revit2025已经更新,安装后,简单试了下,还是挺不错的,流畅度啊,新功能啊,看来还是有听取用户意见的,接下来就简单看看都有哪些新功能。 好了,今天的…...

Head First Design Patterns -代理模式

什么是代理模式 代理模式为另一个对象提供替身或者占位符,以便控制客户对对象的访问,管理访问的方式有很多种。例如远程代理、虚拟代理、保护代理等。 远程代理:管理客户和远程对象之间的交互。 虚拟代理:控制访问实例化开销大的对…...

第十三题:天干地支

题目描述 古代中国使用天干地支来记录当前的年份。 天干一共有十个,分别为:甲(jiǎ)、乙(yǐ)、丙(bǐng)、丁(dīng)、戊(w)、己&a…...

8000预算可以购买阿里云服务器配置整理

一个月8000元预算如何选择阿里云服务器配置?八千预算可选的阿里云服务器配置相当高了,这个预算可以购买阿里云企业级独享型云服务器,至少8核以上的配置,这个预算可以支持复杂、高负载或大规模的业务需求。阿里云服务器网整理8000元…...

游戏APP如何提高广告变现收益的同时,保证用户留存率?

APP广告变现对接第三方聚合广告平台主要通过SDK文档对接,一些媒体APP不具备专业运营广告变现的对接能力和资源沉淀,导致APP被封控,设置列入黑名单,借助第三方聚合广告平台进行商业化变现是最佳选择。#APP广告变现# 接入第三方平台…...

Linux ulimit命令教程:如何查看和设置系统资源限制(附实例详解和注意事项)

Linux ulimit命令介绍 ulimit是一个内置的Linux shell命令,它允许查看或限制单个用户可以消耗的系统资源量。在有多个用户和系统性能问题的环境中,限制资源使用是非常有价值的。 Linux ulimit命令适用的Linux版本 ulimit命令在所有主流的Linux发行版中…...

(delphi11最新学习资料) Object Pascal 学习笔记---第8章第5节(封闭类和Final方法)

8.5.2 封闭类和Final方法 如前所述,Java 采用非常动态的方法,默认情况下采用延迟绑定(或虚函数)。因此,Java 语言引入了一些概念,如不能继承的类(封闭类)和不能在派生类中覆盖的方法…...

vue3从精通到入门12:vue3的生命周期和组件

生命周期: 生命周期钩子主要包括: beforeCreate:组件实例被创建之前调用。在这个阶段,组件的 props 和 data 还未被初始化。created:组件实例创建完成后调用。在这个阶段,组件的 props 和 data 已经被初始…...

力扣热题100_链表_21_合并两个有序链表

文章目录 题目链接解题思路解题代码 题目链接 21. 合并两个有序链表 将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 示例 1: 输入:l1 [1,2,4], l2 [1,3,4] 输出:[1,1,2,3,4,4] 示例…...

探索未来智慧酒店网项目接口架构

在数字化时代,智慧酒店已成为酒店业发展的重要趋势之一。智慧酒店网项目接口架构作为支撑智慧酒店运营的核心技术之一,其设计和优化对于提升用户体验、提高管理效率具有重要意义。本文将深入探讨智慧酒店网项目接口架构的设计理念和关键要素。 ### 智慧…...

os模块篇(十三)

文章目录 os.mknod(path, mode0o600, device0, *, dir_fdNone)os.major(device, /)os.minor(device, /)os.makedev(major, minor, /)os.pathconf(path, name)os.readlink(path, *, dir_fdNone)os.remove(path, *, dir_fdNone)os.removedirs(name)os.rename(src, dst, *, src_di…...

【JavaEE初阶系列】——文件操作 IO 之 文件系统操作

目录 📝认识文件 🚩树型结构组织 和 目录 🎈绝对路径和相对路径 🚩文件类型 📝文件系统操作 🎈File 概述 🎈File类的使用 1. 绝对路径 vs 相对路径 2. 路径分隔符 3. 静态成员变量 4…...

JAVA 学习·类与方法

不同于 C ,Java 是一门面向对象的编程语言。C 也有面向对象的内容,但是 C 和 Java 在方法的具体实现上存在区别。 方法的定义 方法(method)是为执行一个复杂操作组合在一起的语句集合。一个类中可以声明多个方法。其语法是采用 BNF 范式(Bac…...

4. python练习题4-水仙花数

4. python练习题4-水仙花数 【目录】 文章目录 4. python练习题4-水仙花数1. 目标任务2. 水仙花数的特点3. 如何判断一个数是否是水仙花数?4. 打印3位水仙花数5. 判断一个数是不是水仙花数6. 列表推导式6. 列表推导式判断一个数是不是水仙花数 【正文】 1. 目标任务…...

【Qt 学习笔记】Qt 开发环境的搭建 | Qt 安装教程

博客主页:Duck Bro 博客主页系列专栏:Qt 专栏关注博主,后期持续更新系列文章如果有错误感谢请大家批评指出,及时修改感谢大家点赞👍收藏⭐评论✍ Qt 开发环境的搭建 | Qt 安装教程 文章编号:Qt 学习笔记 /…...

ids工业相机与电控位移台同步控制及数据采集

通过VS2017和OpenCV,实现ids工业相机与电控位移台同步控制及数据采集 目录项目环境配置代码流程及思路项目架构项目开发运行效果开发关键ids相机配置位移台环境配置相机头文件相机参数设置保存图像函数设置电控位移台头文件电控位移台设置参数最后就是通过main函数进行调用和控…...

景联文科技提供高质量医疗健康AI大模型数据

医疗行业是典型的知识和技术密集型行业,其发展水平直接关系到国民健康和生命质量。 医疗健康AI大模型,作为人工智能的一个分支,能够通过学习大量的数据来生成新的数据实例,在医药研发、医学影像、医疗文本分析等都有广泛的应用前景…...

【Python第三方库】lxml 解析器和xpath路径语言

1.lxml是做什么的 是xml/html的解析器,主要是用来解析和提取html/xml数据 2.lxml语法 使用etree.HTML(html字符串),将字符串转换为Element对象通过使用Element对象.xpath(语法)提取信息,返回的是一个列表的内存地址,需要通过使用索引获取信…...

Java(Lambda、集合)、题解

一、Lambda表达式 标准格式 ()对应方法的形参 ;->固定格式 注意点: Lambda表达式可以用来简化匿名内部类的书写 Lambda表达式只能简化函数式接口的匿名内部类的写法 函数式接口: 有且仅有一个抽象方法的接口叫做函数式接口&…...

鸿蒙中用HarmonyOS SDK应用服务 HarmonyOS5开发一个医院挂号小程序

一、开发准备 ​​环境搭建​​: 安装DevEco Studio 3.0或更高版本配置HarmonyOS SDK申请开发者账号 ​​项目创建​​: File > New > Create Project > Application (选择"Empty Ability") 二、核心功能实现 1. 医院科室展示 /…...

前端开发面试题总结-JavaScript篇(一)

文章目录 JavaScript高频问答一、作用域与闭包1.什么是闭包(Closure)?闭包有什么应用场景和潜在问题?2.解释 JavaScript 的作用域链(Scope Chain) 二、原型与继承3.原型链是什么?如何实现继承&a…...

云原生安全实战:API网关Kong的鉴权与限流详解

🔥「炎码工坊」技术弹药已装填! 点击关注 → 解锁工业级干货【工具实测|项目避坑|源码燃烧指南】 一、基础概念 1. API网关(API Gateway) API网关是微服务架构中的核心组件,负责统一管理所有API的流量入口。它像一座…...

【Android】Android 开发 ADB 常用指令

查看当前连接的设备 adb devices 连接设备 adb connect 设备IP 断开已连接的设备 adb disconnect 设备IP 安装应用 adb install 安装包的路径 卸载应用 adb uninstall 应用包名 查看已安装的应用包名 adb shell pm list packages 查看已安装的第三方应用包名 adb shell pm list…...

【LeetCode】3309. 连接二进制表示可形成的最大数值(递归|回溯|位运算)

LeetCode 3309. 连接二进制表示可形成的最大数值(中等) 题目描述解题思路Java代码 题目描述 题目链接:LeetCode 3309. 连接二进制表示可形成的最大数值(中等) 给你一个长度为 3 的整数数组 nums。 现以某种顺序 连接…...

mac:大模型系列测试

0 MAC 前几天经过学生优惠以及国补17K入手了mac studio,然后这两天亲自测试其模型行运用能力如何,是否支持微调、推理速度等能力。下面进入正文。 1 mac 与 unsloth 按照下面的进行安装以及测试,是可以跑通文章里面的代码。训练速度也是很快的。 注意…...

篇章二 论坛系统——系统设计

目录 2.系统设计 2.1 技术选型 2.2 设计数据库结构 2.2.1 数据库实体 1. 数据库设计 1.1 数据库名: forum db 1.2 表的设计 1.3 编写SQL 2.系统设计 2.1 技术选型 2.2 设计数据库结构 2.2.1 数据库实体 通过需求分析获得概念类并结合业务实现过程中的技术需要&#x…...

门静脉高压——表现

一、门静脉高压表现 00:01 1. 门静脉构成 00:13 组成结构:由肠系膜上静脉和脾静脉汇合构成,是肝脏血液供应的主要来源。淤血后果:门静脉淤血会同时导致脾静脉和肠系膜上静脉淤血,引发后续系列症状。 2. 脾大和脾功能亢进 00:46 …...

6.计算机网络核心知识点精要手册

计算机网络核心知识点精要手册 1.协议基础篇 网络协议三要素 语法:数据与控制信息的结构或格式,如同语言中的语法规则语义:控制信息的具体含义和响应方式,规定通信双方"说什么"同步:事件执行的顺序与时序…...

数据挖掘是什么?数据挖掘技术有哪些?

目录 一、数据挖掘是什么 二、常见的数据挖掘技术 1. 关联规则挖掘 2. 分类算法 3. 聚类分析 4. 回归分析 三、数据挖掘的应用领域 1. 商业领域 2. 医疗领域 3. 金融领域 4. 其他领域 四、数据挖掘面临的挑战和未来趋势 1. 面临的挑战 2. 未来趋势 五、总结 数据…...