<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>OUR + YOUR SPACE</title>
    <link>https://tcss.tistory.com/</link>
    <description></description>
    <language>ko</language>
    <pubDate>Wed, 22 Jul 2026 15:42:00 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>으누아빠</managingEditor>
    <item>
      <title>[GPT][INVESTORGPT] Search Tool</title>
      <link>https://tcss.tistory.com/entry/GPTINVESTORGPT-Search-Tool</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;DuckDuckGoSearch를&amp;nbsp;이용하여&amp;nbsp;해당&amp;nbsp;search에서&amp;nbsp;데이터를&amp;nbsp;가져와&amp;nbsp;답변하도록&amp;nbsp;한다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;3724&quot; data-origin-height=&quot;2014&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dsyHMX/btsHvJh2iKt/fgoERJtKGj1g8t4XJA8Bqk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dsyHMX/btsHvJh2iKt/fgoERJtKGj1g8t4XJA8Bqk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dsyHMX/btsHvJh2iKt/fgoERJtKGj1g8t4XJA8Bqk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdsyHMX%2FbtsHvJh2iKt%2FfgoERJtKGj1g8t4XJA8Bqk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;3724&quot; height=&quot;2014&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;3724&quot; data-origin-height=&quot;2014&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;background-color: #292d3e; color: #babed8;&quot;&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;typing&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;Type&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;chat_models&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatOpenAI&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;tools&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;BaseTool&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;pydantic&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;BaseModel&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;Field&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;agents&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;initialize_agent&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;AgentType&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;utilities&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; DuckDuckGoSearchAPIWrapper&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatOpenAI&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;temperature&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;0.1&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;StockMarketSymbolSearchToolArgsSchema&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;BaseModel&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;Field&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;description&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;The query you will search for.Example query: Stock Market Symbol for Apple Company&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;StockMarketSymbolSearchTool&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;BaseTool&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;StockMarketSymbolSearchTool&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;description&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Use this tool to find the stock market symbol for a company.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; It takes a query as an argument.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Example query: Stock Market Symbol for Apple Company&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;args_schem&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;Type&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;StockMarketSymbolSearchToolArgsSchema&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;StockMarketSymbolSearchToolArgsSchema&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;_run&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;ddg&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;DuckDuckGoSearchAPIWrapper&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;ddg&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.run&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;agent&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;initialize_agent&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;verbose&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;True&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;agent&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;AgentType&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;OPENAI_FUNCTIONS&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;handle_parsing_erros&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;True&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;tools&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=[&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;StockMarketSymbolSearchTool&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(),&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;],&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;prompt&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Give me information on Cloudflare's stock and help me analyze if it's a potential good investment. Also tell me what symbol does the stock have.&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;agent&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;prompt&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;[결과]&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt;&lt;span&gt;&amp;gt; Entering new AgentExecutor chain...&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Invoking: `StockMarketSymbolSearchTool` with `Cloudflare` &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;Read the latest posts from Cloudflare's official blog, covering topics such as security, DNS, email, AI, developer tools, and more. Learn about Cloudflare's features, innovations, acquisitions, and events from the source. Following its initial announcement in September 2022, Cloudflare Calls is now in open beta and available in your Cloudflare Dashboard.Cloudflare Calls lets developers build real-time audio/video apps using WebRTC, and it abstracts away the complexity by turning the Cloudflare network into a singular SFU.In this post, we dig into how we make this possible. Cloudflare's Year in Review revealed that in 2023 alone, there was a 25% increase in global traffic, with no signs of slowing. This growth underscores the dependency on Internet services to facilitate and underpin vital systems and tasks such as supporting global digital economies, enabling the operations of healthcare networks, maintaining ... Press Releases 2024. Press Releases. 2024. US Department of Treasury, Pacific Northwest National Laboratory, and Cloudflare Partner to Share Early Warning Threat Intelligence for Financial Institutions. May 09, 2024. Cloudflare Announces Unified Risk Posture to Provide Comprehensive and Continuous Risk Management at Scale&amp;mdash;for Free. May 07, 2024. Finally, because Cloudflare also operates a CDN, websites that are already on Cloudflare will be given a &quot;hot-path,&quot; and will load faster. We at Cloudflare are always striving to bring more privacy options to the open Internet, and we are excited to provide more private and secure browsing to Edge users.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;span&gt;The stock market symbol for Cloudflare is NET. &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;As for analyzing if Cloudflare is a potential good investment, it's important to consider various factors such as the company's financial performance, growth potential, competitive landscape, and market trends. Here are some points to consider: &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;1. **Financial Performance**: Look at Cloudflare's revenue growth, profitability, and cash flow. Analyze their quarterly and annual financial reports to understand their financial health. &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;2. **Growth Potential**: Evaluate Cloudflare's market position, product offerings, and expansion plans. Consider if they are in a growing industry and have the potential for future growth. &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;3. **Competitive Landscape**: Assess Cloudflare's competitors and how they differentiate themselves in the market. Look at their market share and competitive advantages. &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;4. **Market Trends**: Consider industry trends, technological advancements, and regulatory changes that could impact Cloudflare's business. &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;5. **Risk Factors**: Identify any potential risks that could affect Cloudflare's stock performance, such as cybersecurity threats, regulatory challenges, or economic downturns. &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;It's recommended to consult with a financial advisor or do further research to make an informed decision on whether Cloudflare is a good investment for you.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&amp;gt; Finished chain.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt;{'input': &quot;Give me information on Cloudflare's stock and help me analyze if it's a potential good investment. Also tell me what symbol does the stock have.&quot;, &lt;/span&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt; 'output': &quot;The stock market symbol for Cloudflare is NET. \n\nAs for analyzing if Cloudflare is a potential good investment, it's important to consider various factors such as the company's financial performance, growth potential, competitive landscape, and market trends. Here are some points to consider:\n\n1. **Financial Performance**: Look at Cloudflare's revenue growth, profitability, and cash flow. Analyze their quarterly and annual financial reports to understand their financial health.\n\n2. **Growth Potential**: Evaluate Cloudflare's market position, product offerings, and expansion plans. Consider if they are in a growing industry and have the potential for future growth.\n\n3. **Competitive Landscape**: Assess Cloudflare's competitors and how they differentiate themselves in the market. Look at their market share and competitive advantages.\n\n4. **Market Trends**: Consider industry trends, technological advancements, and regulatory changes that could impact Cloudflare's business.\n\n5. **Risk Factors**: Identify any potential risks that could affect Cloudflare's stock performance, such as cybersecurity threats, regulatory challenges, or economic downturns.\n\nIt's recommended to consult with a financial advisor or do further research to make an informed decision on whether Cloudflare is a good investment for you.&quot;}&lt;/span&gt;&lt;/p&gt;</description>
      <category>python</category>
      <category>DuckDuckGo</category>
      <author>으누아빠</author>
      <guid isPermaLink="true">https://tcss.tistory.com/492</guid>
      <comments>https://tcss.tistory.com/entry/GPTINVESTORGPT-Search-Tool#entry492comment</comments>
      <pubDate>Mon, 20 May 2024 20:34:09 +0900</pubDate>
    </item>
    <item>
      <title>[GPT][INVESTORGPT] OpenAI Functions Agent</title>
      <link>https://tcss.tistory.com/entry/GPTINVESTORGPT-OpenAI-Functions-Agent</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;3088&quot; data-origin-height=&quot;1930&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bupqAL/btsHwBi41Ok/VY8XWC0Xg2HW2yPkRcd3h1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bupqAL/btsHwBi41Ok/VY8XWC0Xg2HW2yPkRcd3h1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bupqAL/btsHwBi41Ok/VY8XWC0Xg2HW2yPkRcd3h1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbupqAL%2FbtsHwBi41Ok%2FVY8XWC0Xg2HW2yPkRcd3h1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;3088&quot; height=&quot;1930&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;3088&quot; data-origin-height=&quot;1930&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;background-color: #292d3e; color: #babed8; text-align: start;&quot;&gt;OPENAI_FUNCTIONS&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이경우 데이터의 형태를 지정하지 않으면 오류를 발생함&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;b&gt; &lt;span style=&quot;text-align: start;&quot;&gt;InvalidRequestError&lt;/span&gt;&lt;span style=&quot;text-align: start;&quot;&gt;: Invalid 'functions[0].name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.&lt;/span&gt; &lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;background-color: #292d3e; color: #babed8;&quot;&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;typing&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;Type&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;chat_models&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatOpenAI&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;tools&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;BaseTool&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;pydantic&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;BaseModel&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;Field&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;agents&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;initialize_agent&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;AgentType&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatOpenAI&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;temperature&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;0.1&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;CalculatorToolArgsSchemea&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;BaseModel&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;Field&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;description&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;The First number&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;Field&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;description&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;The second number&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;CalculatorTool&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;BaseTool&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;SumsCalculator&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;description&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Use this to perform sums of two numbers.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The first and second arguments should be numbers.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Only receives two arguments.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;args_schema&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;Type&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;CalculatorToolArgsSchemea&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;CalculatorToolArgsSchemea&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;_run&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;b&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;agent&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;initialize_agent&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;verbose&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;True&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;agent&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;AgentType&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;OPENAI_FUNCTIONS&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;handle_parsing_erros&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;True&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;tools&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=[&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;CalculatorTool&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(),&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;],&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;prompt&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Tell me Total Cost of $355.39 + $924.87 + $721.2 + $1940.29 + $573.63 + $65.72 + $35.00 + $552.00 + $76.16 + $29.12&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;agent&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;prompt&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;pydantic&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;데이터 유효성 검사는 데이터가 각 속성에 대해 정의한 일련의 규칙, 스키마 또는 제약 조건을 준수하도록 하는 프로세스&lt;br /&gt;데이터 유효성 검사를 통과하면 코드가 예상했던 정확한 방식으로 데이터를 수집하고 반환&lt;br /&gt;&lt;br /&gt;데이터 유효성 검사는 잘못된 사용자 입력과 같은 문제로 인해 발생하는 예기치 않은 오류를 방지&lt;br /&gt;그런 의미에서 sanitization process라고도 함&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;Field&lt;/b&gt; &lt;br /&gt;모델&amp;nbsp;스키마&amp;nbsp;또는&amp;nbsp;복잡한&amp;nbsp;유효성&amp;nbsp;검사를&amp;nbsp;위해&amp;nbsp;필드에&amp;nbsp;대한&amp;nbsp;추가&amp;nbsp;정보를&amp;nbsp;제공하는&amp;nbsp;데&amp;nbsp;사용&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>python</category>
      <category>openai_functions</category>
      <category>Pydantic</category>
      <author>으누아빠</author>
      <guid isPermaLink="true">https://tcss.tistory.com/491</guid>
      <comments>https://tcss.tistory.com/entry/GPTINVESTORGPT-OpenAI-Functions-Agent#entry491comment</comments>
      <pubDate>Mon, 20 May 2024 19:58:59 +0900</pubDate>
    </item>
    <item>
      <title>[GPT][INVESTORGPT] Zero-shot ReAct Agent</title>
      <link>https://tcss.tistory.com/entry/GPTINVESTORGPT-Zero-shot-ReAct-Agent</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;5022&quot; data-origin-height=&quot;1552&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/baJbwb/btsHweaqjbN/m0GRjI89EBIrkk8J1qvkE0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/baJbwb/btsHweaqjbN/m0GRjI89EBIrkk8J1qvkE0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/baJbwb/btsHweaqjbN/m0GRjI89EBIrkk8J1qvkE0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbaJbwb%2FbtsHweaqjbN%2Fm0GRjI89EBIrkk8J1qvkE0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;5022&quot; height=&quot;1552&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;5022&quot; data-origin-height=&quot;1552&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;background-color: #292d3e; color: #babed8;&quot;&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;chat_models&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatOpenAI&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;tools&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;Tool&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;agents&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;initialize_agent&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;AgentType&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatOpenAI&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;temperature&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;0.1&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;plus&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.split&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;agent&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;initialize_agent&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;verbose&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;True&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;agent&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;AgentType&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;ZERO_SHOT_REACT_DESCRIPTION&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;handle_parsing_erros&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;True&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;tools&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=[&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;Tool&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_function&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;func&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;plus&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Sum Calculator&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;description&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Use this to perform sums of two numbers. This tool take two arguments, both should be numbers. till finish. Use this tool by sending a pair of number separated by a comma. &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt; Example: 2,3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;],&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;prompt&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Tell me Total Cost of $355.39 + $924.87 + $721.2 + $1940.29 + $573.63 + $65.72 + $35.00 + $552.00 + $76.16 + $29.12&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #676e95;&quot;&gt;#llm.invoke(prompt)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;agent&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;prompt&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;Zero-shot ReAct&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;작업과 도구 설명을 보고 사용할 도구를 결정&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;ReAct는 Reasoning + Acting으로 Yao et al. (2022)의 논문에 소개된 개념&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;Reasoning은 생각(Chain-of-Thought, COT), Acting은 외부 도구 실행을 의미&lt;br /&gt;&lt;br /&gt;필요한&amp;nbsp;작업에&amp;nbsp;따라&amp;nbsp;정하면&amp;nbsp;되는데,&amp;nbsp;Zero-shot&amp;nbsp;ReAct가&amp;nbsp;가장&amp;nbsp;기본이&amp;nbsp;되는&amp;nbsp;Agent&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;전달 받는값은 1개로 제한되며, 이를 분리하여 사용한다.&lt;/p&gt;</description>
      <category>python</category>
      <category>zero-shot react</category>
      <author>으누아빠</author>
      <guid isPermaLink="true">https://tcss.tistory.com/490</guid>
      <comments>https://tcss.tistory.com/entry/GPTINVESTORGPT-Zero-shot-ReAct-Agent#entry490comment</comments>
      <pubDate>Mon, 20 May 2024 15:15:12 +0900</pubDate>
    </item>
    <item>
      <title>[GPT][INVESTORGPT] Agent</title>
      <link>https://tcss.tistory.com/entry/GPTINVESTORGPT-Agent</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;3264&quot; data-origin-height=&quot;1468&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dYapLM/btsHvwo4eOB/ctAsBRbhpejOIQxKJ4XMlk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dYapLM/btsHvwo4eOB/ctAsBRbhpejOIQxKJ4XMlk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dYapLM/btsHvwo4eOB/ctAsBRbhpejOIQxKJ4XMlk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdYapLM%2FbtsHvwo4eOB%2FctAsBRbhpejOIQxKJ4XMlk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;3264&quot; height=&quot;1468&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;3264&quot; data-origin-height=&quot;1468&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&amp;gt; Entering new AgentExecutor chain...&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;span&gt;Thought: I can use the Sum Calculator tool to find the total cost of all the given amounts. &lt;/span&gt;&lt;span&gt;Action: &lt;/span&gt;&lt;span&gt;``` &lt;/span&gt;&lt;span&gt;{ &lt;/span&gt;&lt;span&gt; &quot;action&quot;: &quot;Sum Calculator&quot;, &lt;/span&gt;&lt;span&gt; &quot;action_input&quot;: {&quot;a&quot;: 355.39, &quot;b&quot;: 924.87} &lt;/span&gt;&lt;span&gt;} &lt;/span&gt;&lt;span&gt;```&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Observation: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;1280.26&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Thought:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;span&gt;``` &lt;/span&gt;&lt;span&gt;{ &lt;/span&gt;&lt;span&gt; &quot;action&quot;: &quot;Sum Calculator&quot;, &lt;/span&gt;&lt;span&gt; &quot;action_input&quot;: {&quot;a&quot;: 1280.26, &quot;b&quot;: 721.2} &lt;/span&gt;&lt;span&gt;} &lt;/span&gt;&lt;span&gt;```&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Observation: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;2001.46&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Thought:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;span&gt;``` &lt;/span&gt;&lt;span&gt;{ &lt;/span&gt;&lt;span&gt; &quot;action&quot;: &quot;Sum Calculator&quot;, &lt;/span&gt;&lt;span&gt; &quot;action_input&quot;: {&quot;a&quot;: 2001.46, &quot;b&quot;: 1940.29} &lt;/span&gt;&lt;span&gt;} &lt;/span&gt;&lt;span&gt;```&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Observation: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;3941.75&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Thought:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;span&gt;``` &lt;/span&gt;&lt;span&gt;{ &lt;/span&gt;&lt;span&gt; &quot;action&quot;: &quot;Sum Calculator&quot;, &lt;/span&gt;&lt;span&gt; &quot;action_input&quot;: {&quot;a&quot;: 3941.75, &quot;b&quot;: 573.63} &lt;/span&gt;&lt;span&gt;} &lt;/span&gt;&lt;span&gt;```&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Observation: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;4515.38&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Thought:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;span&gt;``` &lt;/span&gt;&lt;span&gt;{ &lt;/span&gt;&lt;span&gt; &quot;action&quot;: &quot;Sum Calculator&quot;, &lt;/span&gt;&lt;span&gt; &quot;action_input&quot;: {&quot;a&quot;: 4515.38, &quot;b&quot;: 65.72} &lt;/span&gt;&lt;span&gt;} &lt;/span&gt;&lt;span&gt;```&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Observation: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;4581.1&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Thought:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;span&gt;``` &lt;/span&gt;&lt;span&gt;{ &lt;/span&gt;&lt;span&gt; &quot;action&quot;: &quot;Sum Calculator&quot;, &lt;/span&gt;&lt;span&gt; &quot;action_input&quot;: {&quot;a&quot;: 4581.1, &quot;b&quot;: 35.00} &lt;/span&gt;&lt;span&gt;} &lt;/span&gt;&lt;span&gt;```&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Observation: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;4616.1&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Thought:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;span&gt;``` &lt;/span&gt;&lt;span&gt;{ &lt;/span&gt;&lt;span&gt; &quot;action&quot;: &quot;Sum Calculator&quot;, &lt;/span&gt;&lt;span&gt; &quot;action_input&quot;: {&quot;a&quot;: 4616.1, &quot;b&quot;: 552.00} &lt;/span&gt;&lt;span&gt;} &lt;/span&gt;&lt;span&gt;```&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Observation: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;5168.1&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Thought:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;span&gt;``` &lt;/span&gt;&lt;span&gt;{ &lt;/span&gt;&lt;span&gt; &quot;action&quot;: &quot;Sum Calculator&quot;, &lt;/span&gt;&lt;span&gt; &quot;action_input&quot;: {&quot;a&quot;: 5168.1, &quot;b&quot;: 76.16} &lt;/span&gt;&lt;span&gt;} &lt;/span&gt;&lt;span&gt;```&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Observation: &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;5244.26&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Thought:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;span&gt;``` &lt;/span&gt;&lt;span&gt;{ &lt;/span&gt;&lt;span&gt; &quot;action&quot;: &quot;Sum Calculator&quot;, &lt;/span&gt;&lt;span&gt; &quot;action_input&quot;: {&quot;a&quot;: 5244.26, &quot;b&quot;: 29.12} &lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt;{'input': 'Tell me Total Cost of $355.39 + $924.87 + $721.2 + $1940.29 + $573.63 + $65.72 + $35.00 + $552.00 + $76.16 + $29.12', &lt;/span&gt;&lt;span style=&quot;color: #babed8; text-align: start;&quot;&gt; 'output': 'I have calculated the total cost of all the given amounts. The final answer is $5273.38.'}&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;background-color: #292d3e; color: #babed8;&quot;&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;chat_models&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatOpenAI&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;tools&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;StructuredTool&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;agents&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;initialize_agent&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;AgentType&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatOpenAI&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;temperature&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;0.1&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;plus&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;b&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;agent&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;initialize_agent&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;verbose&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;True&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;agent&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;AgentType&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;tools&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=[&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;StructuredTool&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_function&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;func&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;plus&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Sum Calculator&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;description&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Use this to perform sums of two numbers. This tool take two arguments, both should be numbers. till finish.&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;],&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;prompt&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Tell me Total Cost of $355.39 + $924.87 + $721.2 + $1940.29 + $573.63 + $65.72 + $35.00 + $552.00 + $76.16 + $29.12&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #676e95;&quot;&gt;#llm.invoke(prompt)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;agent&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;prompt&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;llm 은 연산을 목적으로 만들어진것이 아니기 때문에 잘못된 정보를 호출하게됨. 이를 막기 위해서 agent를 이용하여&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;정상적인 답이 나오도록 수정할수 있음&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;agent&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;에이전트의 핵심 아이디어는 언어 모델을 사용하여 수행할 일련의 작업을 선택&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;체인에서는 일련의 작업이 코드로 하드코딩됨&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;에이전트에서 언어 모델은 수행할 작업과 순서를 결정하는 추론 엔진으로 사용됩니다. &lt;br /&gt;&lt;br /&gt;즉 agent는 체인이 사용할 도구를 선택해서 지원할 수 있도록하며 LLM을 사용하여 원하는 작업을 수행하는 절차를 정의 하며, 이때 어떠한 도구를 사용하여 목적을 달성할 것인지를 스스로 판단하여 사용&lt;br /&gt;사용자는&amp;nbsp;구현된&amp;nbsp;tool이&amp;nbsp;어떠한&amp;nbsp;동작을&amp;nbsp;하는지&amp;nbsp;정확하게&amp;nbsp;description&amp;nbsp;해주기만&amp;nbsp;하면&amp;nbsp;알아서&amp;nbsp;가져다가&amp;nbsp;쓰도록&amp;nbsp;되어&amp;nbsp;있음&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;StructuredTool&lt;/b&gt; &lt;br /&gt;에이전트가&amp;nbsp;수행할&amp;nbsp;수&amp;nbsp;있는&amp;nbsp;작업을&amp;nbsp;지정해주는&amp;nbsp;&amp;nbsp;기능을&amp;nbsp;함 &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;func - 툴로 등록할 함수 이름을 지정,&amp;nbsp; &lt;br /&gt;name - 툴의 이름,&lt;br /&gt;description - 툴에 대한 설명을 추가&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION&lt;/b&gt; &lt;br /&gt;이 에이전트는 여러 입력이 있는 도구를 호출&lt;/p&gt;</description>
      <category>python</category>
      <category>Agent</category>
      <category>structuredtool</category>
      <category>structured_chat_zero_shot_react_description</category>
      <author>으누아빠</author>
      <guid isPermaLink="true">https://tcss.tistory.com/489</guid>
      <comments>https://tcss.tistory.com/entry/GPTINVESTORGPT-Agent#entry489comment</comments>
      <pubDate>Mon, 20 May 2024 14:17:55 +0900</pubDate>
    </item>
    <item>
      <title>[GPT][MEETINGGPT] 최종 예제</title>
      <link>https://tcss.tistory.com/entry/GPTMEETINGGPT-%EC%B5%9C%EC%A2%85-%EC%98%88%EC%A0%9C</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;3124&quot; data-origin-height=&quot;8986&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/4exq9/btsHnrpfzcA/yDTI7thNnWMWWpB4zTI55k/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/4exq9/btsHnrpfzcA/yDTI7thNnWMWWpB4zTI55k/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/4exq9/btsHnrpfzcA/yDTI7thNnWMWWpB4zTI55k/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F4exq9%2FbtsHnrpfzcA%2FyDTI7thNnWMWWpB4zTI55k%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;3124&quot; height=&quot;8986&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;3124&quot; data-origin-height=&quot;8986&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;background-color: #292d3e; color: #babed8;&quot;&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;storage&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;LocalFileStore&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;streamlit&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;subprocess&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;math&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;pydub&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;AudioSegment&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;glob&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;openai&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;os&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;chat_models&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatOpenAI&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;prompts&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatPromptTemplate&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;document_loaders&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;TextLoader&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;text_splitter&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;RecursiveCharacterTextSplitter&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;schema&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;StrOutputParser&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;vectorstores&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;faiss&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;FAISS&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;embeddings&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;CacheBackedEmbeddings&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;OpenAIEmbeddings&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatOpenAI&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;temperature&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;0.1&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;has_transcript&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;os&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;path&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;exists&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;./.cache/meeting.txt&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;splitter&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;RecursiveCharacterTextSplitter&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_tiktoken_encoder&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_size&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;800&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_overlap&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;cache_data&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;embed_file&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;file_path&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;cache_dir&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;LocalFileStore&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;./.cache/embeddings/&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;splitter&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;RecursiveCharacterTextSplitter&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_tiktoken_encoder&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_size&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;800&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_overlap&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;loader&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;TextLoader&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;file_path&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;utf-8&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;loader&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;load_and_split&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;text_splitter&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;splitter&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;embeddings&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;OpenAIEmbeddings&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;cached_embeddings&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;CacheBackedEmbeddings&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_bytes_store&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;embeddings&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;cache_dir&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;vectorstore&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;FAISS&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_documents&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;cached_embeddings&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;retriever&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;vectorstore&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;as_retriever&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;retriever&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;cache_data&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;transcribe_chunks&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_folder&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;destination&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;has_transcript&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;files&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;glob&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;glob&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_folder&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;/*.mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;files&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;sort&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;files&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;rb&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio_file&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;destination&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;utf-8&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;text_file&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;transcript&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;openai&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;Audio&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;transcribe&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;whisper-1&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio_file&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;text_file&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;write&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;transcript&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;text&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;])&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;cache_data&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;extract_audio_from_video&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video_path&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;has_transcript&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.endswith&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio_path&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video_path&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.replace&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mp4&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;command&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;ffmpeg&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;-y&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;-i&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video_path&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;-vn&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio_path&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;subprocess&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;run&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;command&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;cache_data&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;cut_audio_in_chunks&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio_path&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_size&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunks_folder&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;has_transcript&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;track&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;AudioSegment&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio_path&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_len&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_size&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;1000&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunks&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;math&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;ceil&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;track&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_len&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;range&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunks&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;start_time&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_len&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;end_time&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_len&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;track&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;start_time&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;end_time&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.export&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; f&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;./&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunks_folder&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;/chunk_&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;.mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;format&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;set_page_config&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;page_title&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;MeetingGPT&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;page_icon&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;markdown&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;# MeetingGPT&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Welcome to MeetingGPT, upload a video and I will give you a transcript, a summary and a chat bot to ask any questions about it.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Get started by uploading a video file in the sidebar.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;sidebar&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;file_uploader&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Video&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=[&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mp4&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;avi&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mkv&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mov&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;],&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunks_folder&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;./.cache/chunks&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Loading video...&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video_content&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;read&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.endswith&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video_path&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; f&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;./.cache/&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio_path&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; f&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;./.cache/&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;transcript_path&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio_path&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;txt&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video_path&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; f&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;./.cache/&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio_path&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video_path&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mp4&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;transcript_path&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video_path&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mp4&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;txt&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video_path&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;wb&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;write&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video_content&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;update&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;label&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Extracting audio...&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;extract_audio_from_video&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video_path&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;update&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;label&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Cutting audio segments...&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;cut_audio_in_chunks&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio_path&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunks_folder&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;update&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;label&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Transcribing audio...&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;transcribe_chunks&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunks_folder&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;transcript_path&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;transcript_tab&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;summary_tab&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;qa_tab&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;tabs&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Transcript&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Summary&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Q&amp;amp;A&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;transcript_tab&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;transcript_path&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;r&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;UTF-8&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;write&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;read&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;())&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;summary_tab&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;start&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;button&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Generate summary&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;start&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;loader&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;TextLoader&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;transcript_path&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;utf-8&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;loader&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;load_and_split&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;text_splitter&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;splitter&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;first_summary_prompt&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatPromptTemplate&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_template&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Write a concise summary of the following:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{text}&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CONCISE SUMMARY:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;first_summary_chain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;first_summary_prompt&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;StrOutputParser&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;summary&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;first_summary_chain&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;text&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;page_content&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;refine_prompt&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatPromptTemplate&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_template&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Your job is to produce a final summary.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; We have provided an existing summary up to a certain point: &lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{existing_summary}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; We have the opportunity to refine the existing summary (only if needed) with some more context below.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{context}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Given the new context, refine the original summary.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If the context isn't useful, RETURN the original summary.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Please summarize it in Korean&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;refine_chain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;refine_prompt&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;StrOutputParser&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Summarizing...&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;doc&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;enumerate&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;])&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;update&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;label&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Processing document {&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;+1}/{&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;)-1} &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;summary&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;refine_chain&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;existing_summary&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;summary&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;context&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;doc&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;page_content&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;write&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;summary&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;write&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;summary&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;qa_tab&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;retriever&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;embed_file&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;transcript_path&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;retriever&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;do they talk about marcus aurelius?&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;write&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</description>
      <category>python</category>
      <author>으누아빠</author>
      <guid isPermaLink="true">https://tcss.tistory.com/488</guid>
      <comments>https://tcss.tistory.com/entry/GPTMEETINGGPT-%EC%B5%9C%EC%A2%85-%EC%98%88%EC%A0%9C#entry488comment</comments>
      <pubDate>Tue, 14 May 2024 12:49:39 +0900</pubDate>
    </item>
    <item>
      <title>[GPT][MEETINGGPT] Refine Chain</title>
      <link>https://tcss.tistory.com/entry/GPTMEETINGGPT-Refine-Chain</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;2802&quot; data-origin-height=&quot;2308&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/6dnGX/btsHocLO3mJ/srGaBcnrc7rval3FCZgcSk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/6dnGX/btsHocLO3mJ/srGaBcnrc7rval3FCZgcSk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/6dnGX/btsHocLO3mJ/srGaBcnrc7rval3FCZgcSk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F6dnGX%2FbtsHocLO3mJ%2FsrGaBcnrc7rval3FCZgcSk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;2802&quot; height=&quot;2308&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;2802&quot; data-origin-height=&quot;2308&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;refine[문서 분할-병합 요약] &lt;br /&gt;&amp;nbsp;입력&amp;nbsp;문서를&amp;nbsp;순회하며&amp;nbsp;반복적으로&amp;nbsp;답변을&amp;nbsp;업데이트하여&amp;nbsp;응답을&amp;nbsp;구성합니다.&amp;nbsp; &lt;br /&gt;각&amp;nbsp;문서에&amp;nbsp;대해,&amp;nbsp;모든&amp;nbsp;비문서&amp;nbsp;입력,&amp;nbsp;현재&amp;nbsp;문서,&amp;nbsp;그리고&amp;nbsp;최신&amp;nbsp;중간&amp;nbsp;답변을&amp;nbsp;LLM&amp;nbsp;chain에&amp;nbsp;전달하여&amp;nbsp;새로운&amp;nbsp;답변을&amp;nbsp;얻습니다. &lt;/p&gt;
&lt;div style=&quot;background-color: #292d3e; color: #babed8;&quot;&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;summary_tab&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;start&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;button&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Generate summary&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;start&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;loader&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;TextLoader&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;transcript_path&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;utf-8&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;loader&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;load_and_split&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;text_splitter&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;splitter&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;first_summary_prompt&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatPromptTemplate&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_template&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Write a concise summary of the following:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{text}&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CONCISE SUMMARY:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;first_summary_chain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;first_summary_prompt&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;StrOutputParser&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;summary&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;first_summary_chain&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;text&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;page_content&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;refine_prompt&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatPromptTemplate&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_template&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Your job is to produce a final summary.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; We have provided an existing summary up to a certain point: &lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{existing_summary}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; We have the opportunity to refine the existing summary (only if needed) with some more context below.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{context}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Given the new context, refine the original summary.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If the context isn't useful, RETURN the original summary.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Please summarize it in Korean&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;refine_chain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;refine_prompt&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;StrOutputParser&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Summarizing...&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;doc&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;enumerate&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;])&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;update&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;label&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Processing document {&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;+1}/{&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;)-1} &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;summary&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;refine_chain&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;existing_summary&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;summary&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;context&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;doc&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;page_content&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;write&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;summary&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;write&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;summary&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>python</category>
      <category>refine chain</category>
      <author>으누아빠</author>
      <guid isPermaLink="true">https://tcss.tistory.com/487</guid>
      <comments>https://tcss.tistory.com/entry/GPTMEETINGGPT-Refine-Chain#entry487comment</comments>
      <pubDate>Tue, 14 May 2024 12:47:02 +0900</pubDate>
    </item>
    <item>
      <title>[GPT][MEETINGGPT] Whisper Transcript</title>
      <link>https://tcss.tistory.com/entry/GPTMEETINGGPT-Whisper-Transcript</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;whisper란? &lt;br /&gt;openai에서&amp;nbsp;공개한&amp;nbsp;인공지능&amp;nbsp;모델로&amp;nbsp;음성을&amp;nbsp;텍스트로&amp;nbsp;변환할&amp;nbsp;수&amp;nbsp;있는&amp;nbsp;기술&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;2494&quot; data-origin-height=&quot;796&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cbXm8h/btsHnewOCtu/NdkUaIVYkU3xa1vIAneuB0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cbXm8h/btsHnewOCtu/NdkUaIVYkU3xa1vIAneuB0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cbXm8h/btsHnewOCtu/NdkUaIVYkU3xa1vIAneuB0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcbXm8h%2FbtsHnewOCtu%2FNdkUaIVYkU3xa1vIAneuB0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;2494&quot; height=&quot;796&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;2494&quot; data-origin-height=&quot;796&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;background-color: #292d3e; color: #babed8;&quot;&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;transcribe_chunks&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_folder&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;destination&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;has_transcript&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;files&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;glob&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;glob&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_folder&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;/*.mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;files&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;sort&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;files&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;rb&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio_file&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;destination&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;utf-8&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;text_file&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;transcript&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;openai&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;Audio&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;transcribe&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;whisper-1&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio_file&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;text_file&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;write&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;transcript&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;text&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;])&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;glob.glob()&lt;/b&gt; &lt;br /&gt;특정한 패턴이나 확장자를 가진 파일들의 경로나 이름이 필요할 때가 있음&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;glob 모듈의 glob 함수는 사용자가 제시한 조건에 맞는 파일명을 리스트 형식으로 반환&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;단, 조건에 정규식을 사용할 수 없으며 엑셀 등에서도 사용할 수 있는 '*'와 '?'같은 와일드카드만을 지원 &lt;/p&gt;</description>
      <category>python</category>
      <category>glob</category>
      <category>Whisper</category>
      <author>으누아빠</author>
      <guid isPermaLink="true">https://tcss.tistory.com/486</guid>
      <comments>https://tcss.tistory.com/entry/GPTMEETINGGPT-Whisper-Transcript#entry486comment</comments>
      <pubDate>Tue, 14 May 2024 12:39:59 +0900</pubDate>
    </item>
    <item>
      <title>[GPT][MEETINGGPT] Cutting The Audio</title>
      <link>https://tcss.tistory.com/entry/GPTMEETINGGPT-Cutting-The-Audio</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;pydub&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;pydub은 Python으로 오디오 처리 작업을 수행할 수 있게 하는 유용한 라이브러리 중 하나&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이 라이브러리를 사용하면 오디오 파일의 생성, 변환, 조작, 재생 속도 변경, 오디오 형식 간 변환 등 다양한 작업을 수행할 수 있음&lt;br /&gt;&lt;br /&gt;pydub에서 AudioSegment는 오디오 데이터를 나타내는 핵심 객체입&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이 객체는 여러 오디오 형식(예: MP3, WAV)의 오디오 데이터를 처리하고 다양한 작업을 수행하는 데 사용&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;설치 &lt;br /&gt;&lt;/b&gt;pip&amp;nbsp;install&amp;nbsp;pydub&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;from&amp;nbsp;pydub&amp;nbsp;import&amp;nbsp;AudioSegment&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;1702&quot; data-origin-height=&quot;880&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bC5W4P/btsHpwP1QU2/AUSyqcQeX7qDNWwnKv2NL1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bC5W4P/btsHpwP1QU2/AUSyqcQeX7qDNWwnKv2NL1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bC5W4P/btsHpwP1QU2/AUSyqcQeX7qDNWwnKv2NL1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbC5W4P%2FbtsHpwP1QU2%2FAUSyqcQeX7qDNWwnKv2NL1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1702&quot; height=&quot;880&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;1702&quot; data-origin-height=&quot;880&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;background-color: #292d3e; color: #babed8;&quot;&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;cut_audio_in_chunks&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio_path&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_size&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunks_folder&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;has_transcript&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;track&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;AudioSegment&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio_path&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_len&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_size&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;1000&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunks&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;math&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;ceil&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;track&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_len&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;range&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunks&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;start_time&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_len&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;end_time&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_len&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;track&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;start_time&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;end_time&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.export&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; f&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;./&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunks_folder&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;/chunk_&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;.mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;format&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;AudioSegment.export(파일명, 포멧)&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;변환된 데이터를 내보내는 메서드&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;[예제]&lt;/p&gt;
&lt;div style=&quot;background-color: #292d3e; color: #babed8;&quot;&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;pydub&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;AudioSegment&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #676e95;&quot;&gt;# AudioSegment 객체 생성&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;AudioSegment&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_file&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;input_audio.mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #676e95;&quot;&gt;# 내보낼 파일 형식과 경로 지정&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;output_format&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;wav&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;output_path&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;output_audio.wav&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #676e95;&quot;&gt;# 파일로 내보내기&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.export&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;output_path&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;format&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;output_format&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>python</category>
      <category>audiosegment</category>
      <category>pydub</category>
      <author>으누아빠</author>
      <guid isPermaLink="true">https://tcss.tistory.com/485</guid>
      <comments>https://tcss.tistory.com/entry/GPTMEETINGGPT-Cutting-The-Audio#entry485comment</comments>
      <pubDate>Tue, 14 May 2024 12:25:02 +0900</pubDate>
    </item>
    <item>
      <title>[GPT][MEETINGGPT] Audio Extraction</title>
      <link>https://tcss.tistory.com/entry/GPTMEETINGGPT-Audio-Extraction</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;1. ffmpeg 를 설치 해야함&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;&lt;a href=&quot;https://ffmpeg.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener&amp;nbsp;noreferrer&quot;&gt;https://ffmpeg.org/&lt;/a&gt; 에서 다운로드를 받음&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1129&quot; data-origin-height=&quot;756&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/Tqqud/btsHnh1oLiF/Rl2snSKQBPlAELSthmEz50/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/Tqqud/btsHnh1oLiF/Rl2snSKQBPlAELSthmEz50/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/Tqqud/btsHnh1oLiF/Rl2snSKQBPlAELSthmEz50/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FTqqud%2FbtsHnh1oLiF%2FRl2snSKQBPlAELSthmEz50%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1129&quot; height=&quot;756&quot; data-origin-width=&quot;1129&quot; data-origin-height=&quot;756&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;에서 windows builds from gyan.dev 클릭&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1134&quot; data-origin-height=&quot;660&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/12CHI/btsHpjXEQfA/RoUrIYBPSgrbSL74Bp8f10/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/12CHI/btsHpjXEQfA/RoUrIYBPSgrbSL74Bp8f10/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/12CHI/btsHpjXEQfA/RoUrIYBPSgrbSL74Bp8f10/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F12CHI%2FbtsHpjXEQfA%2FRoUrIYBPSgrbSL74Bp8f10%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1134&quot; height=&quot;660&quot; data-origin-width=&quot;1134&quot; data-origin-height=&quot;660&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;원하는 파일 다운로드 여기서는 &lt;b&gt;ffmpeg-release-essentials.zip&amp;nbsp;&lt;/b&gt;다운로드 후 &lt;b&gt;c:\Program&amp;nbsp;Files\ffmpeg&lt;/b&gt;에&amp;nbsp;복사&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;612&quot; data-origin-height=&quot;130&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/FoTT1/btsHpNqwS7d/g1Z8UsGH48GjjbDnFClv1k/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/FoTT1/btsHpNqwS7d/g1Z8UsGH48GjjbDnFClv1k/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/FoTT1/btsHpNqwS7d/g1Z8UsGH48GjjbDnFClv1k/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FFoTT1%2FbtsHpNqwS7d%2Fg1Z8UsGH48GjjbDnFClv1k%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;612&quot; height=&quot;130&quot; data-origin-width=&quot;612&quot; data-origin-height=&quot;130&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;시스템&amp;nbsp;환경&amp;nbsp;변수에&amp;nbsp;&lt;b&gt;C:\Program&amp;nbsp;Files\ffmpeg\bin&lt;/b&gt;&amp;nbsp;추가&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1072&quot; data-origin-height=&quot;404&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/BQVV3/btsHp3Udvcv/yvlAQ7IMSGAgM2a736U00k/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/BQVV3/btsHp3Udvcv/yvlAQ7IMSGAgM2a736U00k/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/BQVV3/btsHp3Udvcv/yvlAQ7IMSGAgM2a736U00k/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FBQVV3%2FbtsHp3Udvcv%2FyvlAQ7IMSGAgM2a736U00k%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1072&quot; height=&quot;404&quot; data-origin-width=&quot;1072&quot; data-origin-height=&quot;404&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;정상적으로 기동하는 지 확인해야함&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;1394&quot; data-origin-height=&quot;964&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bh1pCa/btsHopqHrzL/9CgTyYqAT7dO6aFKkpYosk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bh1pCa/btsHopqHrzL/9CgTyYqAT7dO6aFKkpYosk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bh1pCa/btsHopqHrzL/9CgTyYqAT7dO6aFKkpYosk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbh1pCa%2FbtsHopqHrzL%2F9CgTyYqAT7dO6aFKkpYosk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1394&quot; height=&quot;964&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;1394&quot; data-origin-height=&quot;964&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;background-color: #292d3e; color: #babed8;&quot;&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;extract_audio_from_video&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video_path&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;has_transcript&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.endswith&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio_path&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video_path&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.replace&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mp4&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;mp3&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;command&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;ffmpeg&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;-y&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;-i&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;video_path&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;-vn&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;audio_path&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;subprocess&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;run&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;command&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;[ffmpeg 옵션 정보]&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;-y&amp;nbsp;묻지&amp;nbsp;않고&amp;nbsp;출력&amp;nbsp;파일을&amp;nbsp;덮어씀 &lt;br /&gt;-i&amp;nbsp;지정된&amp;nbsp;파일을&amp;nbsp;읽는&amp;nbsp;옵션 &lt;br /&gt;-vn&amp;nbsp;비디오&amp;nbsp;스트림을&amp;nbsp;무시하고&amp;nbsp;오디오&amp;nbsp;스트림만&amp;nbsp;처리&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;subprocess.run&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;현재 실행되고 있는 프로세스안에서 또 다른 프로세스를 시작하거나 데이터를 주고 받고자 하는 목적&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>python</category>
      <category>ffmpeg</category>
      <category>subprocess</category>
      <author>으누아빠</author>
      <guid isPermaLink="true">https://tcss.tistory.com/484</guid>
      <comments>https://tcss.tistory.com/entry/GPTMEETINGGPT-Audio-Extraction#entry484comment</comments>
      <pubDate>Tue, 14 May 2024 11:54:25 +0900</pubDate>
    </item>
    <item>
      <title>[GPT][SITEGPT] Map Re Rank Chain</title>
      <link>https://tcss.tistory.com/entry/GPTSITEGPT-Map-Re-Rank-Chain</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;3102&quot; data-origin-height=&quot;7936&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/diKkdR/btsHo9ndkxw/IOC7xSwVyn9VHDPCbmKQvK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/diKkdR/btsHo9ndkxw/IOC7xSwVyn9VHDPCbmKQvK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/diKkdR/btsHo9ndkxw/IOC7xSwVyn9VHDPCbmKQvK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdiKkdR%2FbtsHo9ndkxw%2FIOC7xSwVyn9VHDPCbmKQvK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;3102&quot; height=&quot;7936&quot; data-filename=&quot;code.png&quot; data-origin-width=&quot;3102&quot; data-origin-height=&quot;7936&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;background-color: #292d3e; color: #babed8;&quot;&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;document_loaders&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;SitemapLoader&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;schema&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;runnable&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;RunnableLambda&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;RunnablePassthrough&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;text_splitter&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;RecursiveCharacterTextSplitter&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;vectorstores&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;faiss&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;FAISS&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;embeddings&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;OpenAIEmbeddings&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;chat_models&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatOpenAI&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;langchain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;prompts&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatPromptTemplate&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;bs4&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;BeautifulSoup&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;streamlit&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;asyncio&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;sys&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatOpenAI&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;temperature&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;0.1&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;answers_prompt&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatPromptTemplate&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_template&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Using ONLY the following context answer the user's question. If you can't just say you don't know, don't make anything up.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Then, give a score to the answer between 0 and 5.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; If the answer answers the user question the score should be high, else it should be low.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Make sure to always include the answer's score even if it's 0.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Context: &lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{context}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Examples:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Question: How far away is the moon?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Answer: The moon is 384,400 km away.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Score: 5&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Question: How far away is the sun?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Answer: I don't know&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Score: 0&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Your turn!&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Question: &lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{question}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;get_answers&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;question&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;question&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;answers_chain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;answers_prompt&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;question&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;question&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;answers&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;answer&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;answers_chain&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;question&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;question&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;context&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;doc&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.page_content&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;content&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;doc&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.metadata&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;],&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;doc&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;],&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;choose_answer&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;answers&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;answers&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;question&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;inputs&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;question&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;choose_chain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;choose_prompt&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;llm&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;condensed&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;\n\n&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;join&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; f&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;answer&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;['answer']}&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Source:{&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;answer&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;['source']}&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;answer&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;answers&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;choose_chain&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;question&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;question&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;answers&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;condensed&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;choose_prompt&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;ChatPromptTemplate&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_messages&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;system&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Use ONLY the following pre-existing answers to answer the user's question.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Use the answers that have the highest score (more helpful) and favor the most recent ones.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Cite sources and return the sources of the answers as they are, do not change them.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Answers: &lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{answers}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;human&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #f07178;&quot;&gt;{question}&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;parse_page&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;soup&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;BeautifulSoup&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;soup&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;find&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;footer&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;soup&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;find&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;footer&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;decompose&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;footer&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;footer&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;decompose&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; (&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;soup&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;get_text&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;())&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;\xa0&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;CloseSearch Submit Blog&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;cache_data&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;show_spinner&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Loading website...&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c792ea;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;load_website&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;url&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;splitter&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;RecursiveCharacterTextSplitter&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_tiktoken_encoder&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_size&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;1000&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chunk_overlap&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;200&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;loader&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;SitemapLoader&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;url&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;parsing_function&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;parse_page&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;loader&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;requests_per_second&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f78c6c;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;loader&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;load_and_split&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;text_splitter&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;splitter&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;vector_store&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;FAISS&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;from_documents&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;OpenAIEmbeddings&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;())&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;vector_store&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;as_retriever&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;set_page_config&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;page_title&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;SiteGPT&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;page_icon&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt; ️&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;markdown&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; # SiteGPT&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Ask questions about the content of a website.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&amp;nbsp; &amp;nbsp; Start by writing the URL of the website on the sidebar.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;win32&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;sys&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;platform&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #676e95;&quot;&gt;# Windows specific event-loop policy &amp;amp; cmd&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;asyncio&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;set_event_loop_policy&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;asyncio&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;WindowsSelectorEventLoopPolicy&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;())&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #676e95;&quot;&gt;#asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;cmds&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[[&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;C:/Windows/system32/HOSTNAME.EXE&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #676e95;&quot;&gt;# Unix default event-loop policy &amp;amp; cmds&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;cmds&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;du&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;-sh&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;/Users/fredrik/Desktop&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;],&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;du&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;-sh&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;/Users/fredrik&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;],&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;du&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;-sh&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;/Users/fredrik/Pictures&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;sidebar&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;url&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;text_input&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Write down a URL&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;placeholder&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;&lt;a href=&quot;https://example.com&quot;&gt;https://example.com&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;url&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;.xml&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;url&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;sidebar&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Please write down a Sitemap URL.&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;retriever&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;load_website&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;url&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;text_input&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;Ask a question to the website.&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chain&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; (&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;docs&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;retriever&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;question&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;RunnablePassthrough&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(),&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;RunnableLambda&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;get_answers&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;RunnableLambda&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;choose_answer&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;chain&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffcb6b;&quot;&gt;st&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;markdown&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #babed8;&quot;&gt;content&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #82aaff;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #c3e88d;&quot;&gt;\$&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #89ddff;&quot;&gt;))&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;Map&amp;nbsp;re-rank&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;문서들마다&amp;nbsp;각각의&amp;nbsp;답변을&amp;nbsp;만들어&amp;nbsp;내고,&amp;nbsp;이에&amp;nbsp;점수를&amp;nbsp;부여 &lt;br /&gt;가장&amp;nbsp;높은&amp;nbsp;점수를&amp;nbsp;받은&amp;nbsp;답변을&amp;nbsp;최종&amp;nbsp;답변으로&amp;nbsp;채택함 &lt;br /&gt;&lt;br /&gt;문서가&amp;nbsp;구분되어&amp;nbsp;있고&amp;nbsp;높은&amp;nbsp;유사성을&amp;nbsp;요구할&amp;nbsp;때&amp;nbsp;유용&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;answers_prompt&amp;nbsp;의&amp;nbsp;내용을&amp;nbsp;확인하면&amp;nbsp;예시가&amp;nbsp;존재함&lt;/p&gt;</description>
      <category>python</category>
      <category>map re-rank</category>
      <author>으누아빠</author>
      <guid isPermaLink="true">https://tcss.tistory.com/483</guid>
      <comments>https://tcss.tistory.com/entry/GPTSITEGPT-Map-Re-Rank-Chain#entry483comment</comments>
      <pubDate>Mon, 13 May 2024 18:06:56 +0900</pubDate>
    </item>
  </channel>
</rss>