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

手机网站 qq代码湖南人文科技学院官网首页

手机网站 qq代码,湖南人文科技学院官网首页,以营销为导向的网站建设,元芳重庆网站建设本文将介绍如何使用使用chatglm4实现react#xff0c;利用环境变量、Tavily API和ReAct代理模式来回答用户提出的问题。 环境变量 首先#xff0c;我们需要加载环境变量。这可以通过使用dotenv库来实现。 from dotenv import load_dotenv_ load_dotenv()注意.env文件处于…本文将介绍如何使用使用chatglm4实现react利用环境变量、Tavily API和ReAct代理模式来回答用户提出的问题。 环境变量 首先我们需要加载环境变量。这可以通过使用dotenv库来实现。 from dotenv import load_dotenv_ load_dotenv()注意.env文件处于当前文件同一目录如图 配置 接下来我们需要配置Tavily API和OpenAI API的密钥和基础URL。 import os from typing import Annotatedfrom tavily import TavilyClientfrom autogen import AssistantAgent, UserProxyAgent, config_list_from_json, register_function from autogen.agentchat.contrib.capabilities import teachability from autogen.cache import Cache from autogen.coding import DockerCommandLineCodeExecutor, LocalCommandLineCodeExecutorconfig_list [{ model: GLM-4-Plus, api_key: os.environ[OPENAI_API_KEY], base_url:os.environ[OPENAI_API_BASE]} ]Tavily API 然后我们需要创建一个Tavily API客户端并定义一个搜索工具函数。 tavily TavilyClient(api_keyos.environ[TAVILY_API_KEY])def search_tool(query: Annotated[str, The search query]) - Annotated[str, The search results]:return tavily.get_search_context(queryquery, search_depthadvanced)ReAct代理 接下来我们定义一个ReAct代理模式用于回答用户的问题。 ReAct_prompt Answer the following questions as best you can. You have access to tools provided.Use the following format:Question: the input question you must answer Thought: you should always think about what to do Action: the action to take Action Input: the input to the action Observation: the result of the action ... (this process can repeat multiple times) Thought: I now know the final answer Final Answer: the final answer to the original input questionBegin! Question: {input} def react_prompt_message(sender, recipient, context):return ReAct_prompt.format(inputcontext[question])代码执行器 然后我们设置一个代码执行器用于在容器中运行代码。 os.makedirs(coding, exist_okTrue) code_executor LocalCommandLineCodeExecutor(work_dircoding)用户代理和助手代理 接下来我们创建一个用户代理和一个助手代理用于与用户进行交互。 user_proxy UserProxyAgent(nameUser,is_termination_msglambda x: x.get(content, ) and x.get(content, ).rstrip().endswith(TERMINATE),human_input_modeALWAYS,max_consecutive_auto_reply10,code_execution_config{executor: code_executor}, )assistant AssistantAgent(nameAssistant,system_messageOnly use the tools you have been provided with.Give the args when you need to use the tool. Reply TERMINATE at the end of answer when all the task is done. ,llm_config{config_list: config_list , cache_seed: None}, )注册搜索工具 然后我们将搜索工具注册到助手代理中。 register_function(search_tool,callerassistant,executoruser_proxy,namesearch_tool,descriptionSearch the web for the given query, )缓存 接下来我们使用缓存来存储LLM的响应。 with Cache.disk(cache_seed43) as cache:user_proxy.initiate_chat(assistant,messagereact_prompt_message,questionWhat is the result of super bowl 2024?,cachecache,)输出 [33mUser[0m (to Assistant):Answer the following questions as best you can. You have access to tools provided.Use the following format:Question: the input question you must answer Thought: you should always think about what to do Action: the action to take Action Input: the input to the action Observation: the result of the action ... (this process can repeat multiple times) Thought: I now know the final answer Final Answer: the final answer to the original input questionBegin! Question: What is the result of super bowl 2024?-------------------------------------------------------------------------------- [autogen.oai.client: 11-25 17:31:24] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [33mAssistant[0m (to User):[32m***** Suggested tool call (call_-9217975427127676990): search_tool *****[0m Arguments: {query: Super Bowl 2024 result} [32m************************************************************************[0m-------------------------------------------------------------------------------- [31mNO HUMAN INPUT RECEIVED.[0m [31mUSING AUTO REPLY...[0m [35mEXECUTING FUNCTION search_tool...[0m [33mUser[0m (to Assistant):[33mUser[0m (to Assistant):[32m***** Response from calling tool (call_-9217975427127676990) *****[0m [\{\\\url\\\: \\\https://www.espn.com/nfl/story/_/id/39480722/49ers-chiefs-live-super-bowl-lviii-updates-moments-highlights\\\, \\\content\\\: \\\With a relentless defense and opportune plays by their star quarterback -- including a pair of gutsy overtime scrambles -- the Chiefs won their third Super Bowl in five years in a 25-22 overtime victory against the San Francisco 49ers in only the second overtime game in Super Bowl history.\\\\n Staff\\\\nTaylor Swift supports Travis Kelce, chugs drink at Super Bowl LVIII10hTory Barron\\\\nAfter posting a losing record in December, the Chiefs embraced an underdog, villain mentality throughout the postseason, upsetting three teams en route to their second consecutive Super Bowl title, becoming the ninth team to repeat as Super Bowl champions and first since the 2004 New England Patriots.\\\\n ESPN\\\\nSuper Bowl 2024 - Highlights from Chiefs win vs. 49ers\\\\nMike Tannenbaum and Tim Hasselbeck react to the Chiefs thrilling overtime victory over the 49ers in the Super Bowl. The 49ers had the ball with 2:51 to go in a tied game, but a signature Steve Spagnuolo blitz on third down late in the fourth quarter forced a 49ers field goal. Led by their captains, most of the Chiefs arrived to Allegiant Stadium in Las Vegas on Sunday in all black, signaling a steely resolve to upset Brock Purdy and the NFCs best offensive ensemble.\\\\n\\\}\, \{\\\url\\\: \\\https://www.cbssports.com/nfl/news/2024-super-bowl-chiefs-vs-49ers-score-patrick-mahomes-leads-ot-comeback-as-k-c-wins-back-to-back-titles/live/\\\, \\\content\\\: \\\The championship-winning drive, which included a fourth-and-1 scramble from Mahomes and a clutch 7-yard catch from tight end Travis Kelce, was a must-score for K.C. The NFLs new playoff overtime rules -- both teams are guaranteed at least one possession in the extra period -- were in effect for the first time, and the Chiefs needed to answer the Niners field goal.\\\\n Held out of the end zone until that point, Kansas City grabbed its first lead of the game at 13-10.\\\\nJennings touchdown receiving (followed by a missed extra point) concluded a 75-yard drive that put the Niners back on top, 16-13, as the wideout joined former Philadelphia Eagles quarterback Nick Foles as the only players to throw and catch a touchdown in a Super Bowl.\\\\n He spread the ball around -- eight pass-catchers had at least two receptions -- slowly but surely overcoming a threatening 49ers defense that knocked him off his spot consistently in the first half.\\\\nMahomes, with his third Super Bowl MVP, now sits alongside Tom Brady (five) and Joe Montana (three) atop the mountain while becoming just the third player to win the award back-to-back, joining Bart Starr (I-II) and Terry Bradshaw (XIII-XIV).\\\\n The muffed punt that bounced off of cornerback Darrell Luter Jr.s ankle was also the big break that the Chiefs needed as they scored on the very next play to take the lead for the first time in the game. College Pickem\\\\nA Daily SportsLine Betting Podcast\\\\nNFL Playoff Time!\\\\n2024 Super Bowl, Chiefs vs. 49ers score: Patrick Mahomes leads OT comeback as K.C. wins back-to-back titles\\\\nCall it a dynasty; the Chiefs are the first team to win consecutive Super Bowls since 2003-04\\\\nThe Kansas City Chiefs are Super Bowl champions, again.\\\}\, \{\\\url\\\: \\\https://sports.yahoo.com/super-bowl-2024-chiefs-beat-49ers-in-ot-thriller-on-walk-off-td-pass-by-patrick-mahomes-035151467.html\\\, \\\content\\\: \\\Chiefs beat 49ers in OT thriller on walk-off TD pass by Patrick Mahomes\\\\nThe Kansas City Chiefs are Super Bowl champions for a third time in the Patrick Mahomes era.\\\\n Taylor Swift and the Kelce family make it down to the field after the Chiefs win the Super Bowl \\\\ud83d\\\\udc4f pic.twitter.com/FkbFIMiIxA\\\\n\\\\u2014 The Sporting News (sportingnews) Travis Kelce was excited, as expected:\\\\nTravis never disappoints \\\\ud83d\\\\ude02 #ChiefsKingdom pic.twitter.com/Gr2J7JoF4c\\\\n\\\\u2014 NFL (NFL) February 12, 2024\\\\nPatrick Mahomes: \\\\\\\The Kansas City Chiefs are never underdogs. February 12, 2024\\\\nWith the Super Bowl on the line, the Chiefs just converted on fourth-and-1. February 12, 2024\\\\nNow, the Chiefs convert on third-and-6 to keep the drive moving.\\\\n\\\}\, \{\\\url\\\: \\\https://www.usatoday.com/story/sports/nfl/super-bowl/2024/02/11/super-bowl-2024-score-live-updates/72481979007/\\\, \\\content\\\: \\\- Nate Davis\\\\nThe 58 greatest NFL teams to play in the Super Bowl \\\\u2013 and not all won Lombardi Trophy\\\\nThe 2023 Kansas City Chiefs and San Francisco 49ers will become the 115th and 116th Super Bowl participants on Sunday, when they cross paths at Allegiant Stadium in Las Vegas. Super Bowl 2024 live updates: Keep up with Chiefs vs. 49ers score, highlights and analysis\\\\nThe\\\\u00a0Kansas City Chiefs\\\\u00a0will take on the\\\\u00a0San Francisco 49ers\\\\u00a0in\\\\u00a0Super Bowl 58\\\\u00a0tonight at\\\\u00a0Allegiant Stadium\\\\u00a0in\\\\u00a0Las Vegas\\\\u00a0for\\\\u00a0NFL\\\\u00a0supremacy.\\\\n Meanwhile, the 49ers will don their traditional road white uniform.\\\\u00a0 \\\\u2014 Jordan Mendoza\\\\nSuper Bowl 58 predictions\\\\nHere are our NFL expert picks based on the early odds for Super Bowl 58:\\\\nChiefs vs. 49ers moneyline\\\\nThe most basic of all bets is called the moneyline. \\\\u2014 Cydney Henderson\\\\nHighest-paid players in Super Bowl 58\\\\nHere are the highest-paid players in Super Bowl 58 based on average annual value, according to Over The Cap. \\\\u2014 Cydney Henderson\\\\nThe 58 greatest players in Super Bowl history: Meet the Chiefs kicker\\\\nHarrison Butker\\\\u00a0may be called upon to hit the biggest kick of his career if\\\\u00a0Super Bowl 58\\\\u00a0against the\\\\u00a0San Francisco 49ers\\\\u00a0is close in the fourth quarter.\\\\n\\\}\, \{\\\url\\\: \\\https://apnews.com/live/super-bowl-2024-updates\\\, \\\content\\\: \\\Throw in the fact that Chiefs coach Andy Reid will be in his fifth Super Bowl, the third most in NFL history, and has a chance to win a third ring, and the knowledge on the Kansas City sideline will be an advantage too big for the 49ers to overcome.\\\\n She performed in Japan on Saturday night before a flight across nine time zones and the international date line to reach the U.S.\\\\nRihanna performs during halftime of the NFL Super Bowl 57 football game between the Philadelphia Eagles and the Kansas City Chiefs, Sunday, Feb. 12, 2023, in Glendale, Ariz. (AP Photo/David J. Phillip)\\\\n After the teams take the field, Post Malone will perform \\\\u201cAmerica the Beautiful\\\\u201d and Reba McEntire will sing \\\\u201cThe Star-Spangled Banner.\\\\u201d\\\\nSan Francisco 49ers quarterback Brock Purdy (13) warms up before the NFL Super Bowl 58 football game against the Kansas City Chiefs, Sunday, Feb. 11, 2024, in Las Vegas. He was also the referee when the Chiefs beat the 49ers in the Super Bowl four years ago \\\\u2014 and when the Rams beat the Saints in the 2019 NFC championship game after an infamous missed call.\\\\n Purdy\\\\u2019s comeback from the injury to his throwing arm suffered in last season\\\\u2019s NFC championship loss to the Philadelphia Eagles has been part of the storybook start to his career that started as Mr. Irrelevant as the 262nd pick in the 2022 draft.\\\\n\\\}\] [32m******************************************************************[0m-------------------------------------------------------------------------------- [autogen.oai.client: 11-25 17:31:33] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [33mAssistant[0m (to User):Thought: The result of Super Bowl 2024 has been found.Final Answer: The Kansas City Chiefs won Super Bowl 2024 with a 25-22 overtime victory against the San Francisco 49ers.TERMINATE-------------------------------------------------------------------------------- [31mNO HUMAN INPUT RECEIVED.[0mTeachability能力 最后我们添加Teachability能力到助手代理中并再次与用户进行交互。 teachability teachability.Teachability(verbosity0,reset_dbTrue,path_to_db_dircoding,recall_threshold1.5, )teachability.add_to_agent(assistant)with Cache.disk(cache_seed44) as cache:user_proxy.initiate_chat(assistant,messagereact_prompt_message,questionWhat is the result of super bowl 2024?,cachecache,)输出 [92m CLEARING MEMORY[0m [33mUser[0m (to Assistant):Answer the following questions as best you can. You have access to tools provided.Use the following format:Question: the input question you must answer Thought: you should always think about what to do Action: the action to take Action Input: the input to the action Observation: the result of the action ... (this process can repeat multiple times) Thought: I now know the final answer Final Answer: the final answer to the original input questionBegin! Question: What is the result of super bowl 2024?-------------------------------------------------------------------------------- [autogen.oai.client: 11-25 17:37:22] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:37:24] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:37:25] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:37:26] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing.C:\Users\32564\.cache\chroma\onnx_models\all-MiniLM-L6-v2\onnx.tar.gz: 100%|██████████| 79.3M/79.3M [00:2100:00, 3.92MiB/s][autogen.oai.client: 11-25 17:37:49] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:37:53] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [33mAssistant[0m (to User):[32m***** Suggested tool call (call_-9217975392767912887): search_tool *****[0m Arguments: {query: Super Bowl 2024 result} [32m************************************************************************[0m-------------------------------------------------------------------------------- [31mNO HUMAN INPUT RECEIVED.[0m [31mUSING AUTO REPLY...[0m [35mEXECUTING FUNCTION search_tool...[0m [33mUser[0m (to Assistant):[33mUser[0m (to Assistant):[32m***** Response from calling tool (call_-9217975392767912887) *****[0m [\{\\\url\\\: \\\https://www.espn.com/nfl/story/_/id/39480722/49ers-chiefs-live-super-bowl-lviii-updates-moments-highlights\\\, \\\content\\\: \\\With a relentless defense and opportune plays by their star quarterback -- including a pair of gutsy overtime scrambles -- the Chiefs won their third Super Bowl in five years in a 25-22 overtime victory against the San Francisco 49ers in only the second overtime game in Super Bowl history.\\\\n Staff\\\\nTaylor Swift supports Travis Kelce, chugs drink at Super Bowl LVIII10hTory Barron\\\\nAfter posting a losing record in December, the Chiefs embraced an underdog, villain mentality throughout the postseason, upsetting three teams en route to their second consecutive Super Bowl title, becoming the ninth team to repeat as Super Bowl champions and first since the 2004 New England Patriots.\\\\n ESPN\\\\nSuper Bowl 2024 - Highlights from Chiefs win vs. 49ers\\\\nMike Tannenbaum and Tim Hasselbeck react to the Chiefs thrilling overtime victory over the 49ers in the Super Bowl. The 49ers had the ball with 2:51 to go in a tied game, but a signature Steve Spagnuolo blitz on third down late in the fourth quarter forced a 49ers field goal. Led by their captains, most of the Chiefs arrived to Allegiant Stadium in Las Vegas on Sunday in all black, signaling a steely resolve to upset Brock Purdy and the NFCs best offensive ensemble.\\\\n\\\}\, \{\\\url\\\: \\\https://www.cbssports.com/nfl/news/2024-super-bowl-chiefs-vs-49ers-score-patrick-mahomes-leads-ot-comeback-as-k-c-wins-back-to-back-titles/live/\\\, \\\content\\\: \\\The championship-winning drive, which included a fourth-and-1 scramble from Mahomes and a clutch 7-yard catch from tight end Travis Kelce, was a must-score for K.C. The NFLs new playoff overtime rules -- both teams are guaranteed at least one possession in the extra period -- were in effect for the first time, and the Chiefs needed to answer the Niners field goal.\\\\n Held out of the end zone until that point, Kansas City grabbed its first lead of the game at 13-10.\\\\nJennings touchdown receiving (followed by a missed extra point) concluded a 75-yard drive that put the Niners back on top, 16-13, as the wideout joined former Philadelphia Eagles quarterback Nick Foles as the only players to throw and catch a touchdown in a Super Bowl.\\\\n He spread the ball around -- eight pass-catchers had at least two receptions -- slowly but surely overcoming a threatening 49ers defense that knocked him off his spot consistently in the first half.\\\\nMahomes, with his third Super Bowl MVP, now sits alongside Tom Brady (five) and Joe Montana (three) atop the mountain while becoming just the third player to win the award back-to-back, joining Bart Starr (I-II) and Terry Bradshaw (XIII-XIV).\\\\n The muffed punt that bounced off of cornerback Darrell Luter Jr.s ankle was also the big break that the Chiefs needed as they scored on the very next play to take the lead for the first time in the game. College Pickem\\\\nA Daily SportsLine Betting Podcast\\\\nNFL Playoff Time!\\\\n2024 Super Bowl, Chiefs vs. 49ers score: Patrick Mahomes leads OT comeback as K.C. wins back-to-back titles\\\\nCall it a dynasty; the Chiefs are the first team to win consecutive Super Bowls since 2003-04\\\\nThe Kansas City Chiefs are Super Bowl champions, again.\\\}\, \{\\\url\\\: \\\https://sports.yahoo.com/super-bowl-2024-chiefs-beat-49ers-in-ot-thriller-on-walk-off-td-pass-by-patrick-mahomes-035151467.html\\\, \\\content\\\: \\\Chiefs beat 49ers in OT thriller on walk-off TD pass by Patrick Mahomes\\\\nThe Kansas City Chiefs are Super Bowl champions for a third time in the Patrick Mahomes era.\\\\n Taylor Swift and the Kelce family make it down to the field after the Chiefs win the Super Bowl \\\\ud83d\\\\udc4f pic.twitter.com/FkbFIMiIxA\\\\n\\\\u2014 The Sporting News (sportingnews) Travis Kelce was excited, as expected:\\\\nTravis never disappoints \\\\ud83d\\\\ude02 #ChiefsKingdom pic.twitter.com/Gr2J7JoF4c\\\\n\\\\u2014 NFL (NFL) February 12, 2024\\\\nPatrick Mahomes: \\\\\\\The Kansas City Chiefs are never underdogs. February 12, 2024\\\\nWith the Super Bowl on the line, the Chiefs just converted on fourth-and-1. February 12, 2024\\\\nNow, the Chiefs convert on third-and-6 to keep the drive moving.\\\\n\\\}\, \{\\\url\\\: \\\https://www.usatoday.com/story/sports/nfl/super-bowl/2024/02/11/super-bowl-2024-score-live-updates/72481979007/\\\, \\\content\\\: \\\- Nate Davis\\\\nThe 58 greatest NFL teams to play in the Super Bowl \\\\u2013 and not all won Lombardi Trophy\\\\nThe 2023 Kansas City Chiefs and San Francisco 49ers will become the 115th and 116th Super Bowl participants on Sunday, when they cross paths at Allegiant Stadium in Las Vegas. Super Bowl 2024 live updates: Keep up with Chiefs vs. 49ers score, highlights and analysis\\\\nThe\\\\u00a0Kansas City Chiefs\\\\u00a0will take on the\\\\u00a0San Francisco 49ers\\\\u00a0in\\\\u00a0Super Bowl 58\\\\u00a0tonight at\\\\u00a0Allegiant Stadium\\\\u00a0in\\\\u00a0Las Vegas\\\\u00a0for\\\\u00a0NFL\\\\u00a0supremacy.\\\\n Meanwhile, the 49ers will don their traditional road white uniform.\\\\u00a0 \\\\u2014 Jordan Mendoza\\\\nSuper Bowl 58 predictions\\\\nHere are our NFL expert picks based on the early odds for Super Bowl 58:\\\\nChiefs vs. 49ers moneyline\\\\nThe most basic of all bets is called the moneyline. \\\\u2014 Cydney Henderson\\\\nHighest-paid players in Super Bowl 58\\\\nHere are the highest-paid players in Super Bowl 58 based on average annual value, according to Over The Cap. \\\\u2014 Cydney Henderson\\\\nThe 58 greatest players in Super Bowl history: Meet the Chiefs kicker\\\\nHarrison Butker\\\\u00a0may be called upon to hit the biggest kick of his career if\\\\u00a0Super Bowl 58\\\\u00a0against the\\\\u00a0San Francisco 49ers\\\\u00a0is close in the fourth quarter.\\\\n\\\}\, \{\\\url\\\: \\\https://apnews.com/live/super-bowl-2024-updates\\\, \\\content\\\: \\\Throw in the fact that Chiefs coach Andy Reid will be in his fifth Super Bowl, the third most in NFL history, and has a chance to win a third ring, and the knowledge on the Kansas City sideline will be an advantage too big for the 49ers to overcome.\\\\n She performed in Japan on Saturday night before a flight across nine time zones and the international date line to reach the U.S.\\\\nRihanna performs during halftime of the NFL Super Bowl 57 football game between the Philadelphia Eagles and the Kansas City Chiefs, Sunday, Feb. 12, 2023, in Glendale, Ariz. (AP Photo/David J. Phillip)\\\\n After the teams take the field, Post Malone will perform \\\\u201cAmerica the Beautiful\\\\u201d and Reba McEntire will sing \\\\u201cThe Star-Spangled Banner.\\\\u201d\\\\nSan Francisco 49ers quarterback Brock Purdy (13) warms up before the NFL Super Bowl 58 football game against the Kansas City Chiefs, Sunday, Feb. 11, 2024, in Las Vegas. He was also the referee when the Chiefs beat the 49ers in the Super Bowl four years ago \\\\u2014 and when the Rams beat the Saints in the 2019 NFC championship game after an infamous missed call.\\\\n Purdy\\\\u2019s comeback from the injury to his throwing arm suffered in last season\\\\u2019s NFC championship loss to the Philadelphia Eagles has been part of the storybook start to his career that started as Mr. Irrelevant as the 262nd pick in the 2022 draft.\\\\n\\\}\] [32m******************************************************************[0m-------------------------------------------------------------------------------- [autogen.oai.client: 11-25 17:38:05] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:38:06] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:38:07] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:38:09] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:38:15] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:38:17] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [33mAssistant[0m (to User):Thought: I now know the final answer Final Answer: The Kansas City Chiefs won Super Bowl 2024 with a 25-22 overtime victory against the San Francisco 49ers. TERMINATE-------------------------------------------------------------------------------- [31mNO HUMAN INPUT RECEIVED.[0m再访问一次 # Use a different cache_seed. with Cache.disk(cache_seed110) as cache:user_proxy.initiate_chat(assistant,messagereact_prompt_message,questionWhat is the result of super bowl 2024?,max_turns1,cachecache,)[33mUser[0m (to Assistant):Answer the following questions as best you can. You have access to tools provided.Use the following format:Question: the input question you must answer Thought: you should always think about what to do Action: the action to take Action Input: the input to the action Observation: the result of the action ... (this process can repeat multiple times) Thought: I now know the final answer Final Answer: the final answer to the original input questionBegin! Question: What is the result of super bowl 2024?-------------------------------------------------------------------------------- [autogen.oai.client: 11-25 17:38:47] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:38:50] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:38:51] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:38:51] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:38:54] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:38:54] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:38:55] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:38:56] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [autogen.oai.client: 11-25 17:39:02] {351} WARNING - Model GLM-4-Plus is not found. The cost will be 0. In your config_list, add field {price : [prompt_price_per_1k, completion_token_price_per_1k]} for customized pricing. [33mAssistant[0m (to User):Question: What is the result of Super Bowl 2024?Thought: I have prior knowledge about the Super Bowl 2024 result from the provided memories. I should use this information to answer the question.Action: Utilize the memories to construct the answer.Observation: From the memories: - Chiefs won with a 25-22 overtime victory against the San Francisco 49ers. - It was only the second overtime game in Super Bowl history. - Patrick Mahomes led the winning drive and won his third Super Bowl MVP. - Chiefs became the first team to win consecutive Super Bowls since 2003-04.Thought: I now know the final answer.Final Answer: The Kansas City Chiefs won Super Bowl 2024 with a 25-22 overtime victory against the San Francisco 49ers. This marked their third Super Bowl win in five years and made them the first team to win consecutive Super Bowls since the 2003-04 season. Patrick Mahomes played a crucial role and secured his third Super Bowl MVP award.TERMINATE--------------------------------------------------------------------------------总结 本文介绍了如何使用autogen框架中使用chatglm4模型实现react利用环境变量、Tavily API和ReAct代理模式来回答用户提出的问题。通过使用缓存和Teachability能力我们可以提高系统的性能和准确性。 注意事项 提示词跟llm模型有关对其他的模型需要微调提示词 参考链接https://microsoft.github.io/autogen/0.2/docs/topics/prompting-and-reasoning/react 如果有任何问题欢迎在评论区提问。
http://www.dnsts.com.cn/news/139692.html

相关文章:

  • 网站域名怎么快速备案宝塔无法安装wordpress
  • 医院网站建设安全协议天猫官方网站
  • 学做网站需要掌握哪些知识高权重网站发外链
  • 邮件网站怎么做从哪些方面评价一个企业的网站建设
  • 西安网站seo工作室企业网络拓扑图及说明
  • 圣弓 网站建设论文目录链接怎么做
  • 贵阳网站建设培训遂宁网站seo
  • php和织梦那个做网站好网站联动是什么意思
  • 六安网站建设优化重庆妇科医院在线咨询
  • 网站空间怎么进网页设计模板html代码文本大小
  • 常州建设局网站深圳将进一步优化防控措施
  • 基于html5的旅游网站的设计建设网站 请示 报告
  • 温州制作企业网站潍坊住房公积金官网
  • 云谷系统网站开发wordpress jnews
  • 完整网站建设案例教程网易云跟帖 wordpress
  • 大兴网站建设多少钱帝国cms网站名称
  • 网站设计制作一条龙免费服装网站建设项目规划书
  • 做网站用html5舞蹈培训网站模板
  • 成都建设路小学网站深圳设计公司有哪家
  • 如何做生鲜配送网站生意免费crm客户管理系统
  • 有电脑网站怎样建手机买个购物网站
  • 旅游网站建设流程步骤《电子商务网站建设》精品课
  • 招聘网站建设深圳网页制作基础教程例子ppt
  • 安庆网站建设专wordpress修改访问量
  • 长安东莞网站推广小程序商城代运营
  • 建设通网站不良信用信息撤销东莞市疾控中心官网
  • 精品网站建设需要多少钱软件开发价格标准
  • 受欢迎的大连网站建设张掖作风建设年网站
  • 阿里巴巴的网站怎么做做携程怎样的网站
  • 海拉尔网站建设 网站设计行业门户网站建站