Skip to content

Commit

Permalink
deploy: 7179c42
Browse files Browse the repository at this point in the history
  • Loading branch information
MadcowD committed Sep 25, 2024
1 parent d061d93 commit 8dcf451
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
5 changes: 3 additions & 2 deletions _sources/core_concepts/ell_complex.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ Key Features
print(result.text) # Prints travel advice
if result.tool_calls:
# This is done so that we can pass the tool calls to the language model
tool_results = result.call_tools_and_collect_as_message()
print("Weather info:", tool_results.text)
result_message = result.call_tools_and_collect_as_message()
print("Weather info:", result_message.tool_results[0].text) # Raw text of the tool call.
print("Message to be sent to the LLM:", result_message.text) # Representation of the message to be sent to the LLM.
Reference
Expand Down
5 changes: 3 additions & 2 deletions core_concepts/ell_complex.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,9 @@ <h3>4. Tool Usage<a class="headerlink" href="#tool-usage" title="Link to this he
</span><span id="line-16"><span class="nb">print</span><span class="p">(</span><span class="n">result</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> <span class="c1"># Prints travel advice</span>
</span><span id="line-17"><span class="k">if</span> <span class="n">result</span><span class="o">.</span><span class="n">tool_calls</span><span class="p">:</span>
</span><span id="line-18"> <span class="c1"># This is done so that we can pass the tool calls to the language model</span>
</span><span id="line-19"> <span class="n">tool_results</span> <span class="o">=</span> <span class="n">result</span><span class="o">.</span><span class="n">call_tools_and_collect_as_message</span><span class="p">()</span>
</span><span id="line-20"> <span class="nb">print</span><span class="p">(</span><span class="s2">"Weather info:"</span><span class="p">,</span> <span class="n">tool_results</span><span class="o">.</span><span class="n">text</span><span class="p">)</span>
</span><span id="line-19"> <span class="n">result_message</span> <span class="o">=</span> <span class="n">result</span><span class="o">.</span><span class="n">call_tools_and_collect_as_message</span><span class="p">()</span>
</span><span id="line-20"> <span class="nb">print</span><span class="p">(</span><span class="s2">"Weather info:"</span><span class="p">,</span> <span class="n">result_message</span><span class="o">.</span><span class="n">tool_results</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> <span class="c1"># Raw text of the tool call.</span>
</span><span id="line-21"> <span class="nb">print</span><span class="p">(</span><span class="s2">"Message to be sent to the LLM:"</span><span class="p">,</span> <span class="n">result_message</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> <span class="c1"># Representation of the message to be sent to the LLM.</span>
</span></code></pre></div>
</div>
</section>
Expand Down
9 changes: 7 additions & 2 deletions core_concepts/message_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ <h2>The ell Message API<a class="headerlink" href="#the-ell-message-api" title="
<dt class="sig sig-object py" id="ell.ContentBlock.serialize_parsed">
<span class="sig-name descname"><span class="pre">serialize_parsed</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">BaseModel</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">_info</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#ell.ContentBlock.serialize_parsed" title="Link to this definition" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#ell.ContentBlock.serialize_parsed'"></a></dt>
<dd></dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="ell.ContentBlock.content">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">content</span></span><a class="headerlink" href="#ell.ContentBlock.content" title="Link to this definition" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#ell.ContentBlock.content'"></a></dt>
<dd></dd></dl>
</dd></dl>
<section id="solving-the-construction-problem">
<h3>Solving the construction problem<a class="headerlink" href="#solving-the-construction-problem" title="Link to this heading" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#solving-the-construction-problem'"></a></h3>
Expand Down Expand Up @@ -433,11 +437,11 @@ <h3>Solving the parsing problem<a class="headerlink" href="#solving-the-parsing-
<dl class="py property">
<dt class="sig sig-object py" id="ell.Message.text">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">Message.</span></span><span class="sig-name descname"><span class="pre">text</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">str</span></em><a class="headerlink" href="#ell.Message.text" title="Link to this definition" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#ell.Message.text'"></a></dt>
<dd><p>Returns all text content, replacing non-text content with type indicators.</p>
<dd><p>Returns all text content, replacing non-text content with their representations.</p>
<p class="rubric">Example</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><code><span id="line-1"><span class="gp">&gt;&gt;&gt; </span><span class="n">message</span> <span class="o">=</span> <span class="n">Message</span><span class="p">(</span><span class="n">role</span><span class="o">=</span><span class="s2">"user"</span><span class="p">,</span> <span class="n">content</span><span class="o">=</span><span class="p">[</span><span class="s2">"Hello"</span><span class="p">,</span> <span class="n">PILImage</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="s1">'RGB'</span><span class="p">,</span> <span class="p">(</span><span class="mi">100</span><span class="p">,</span> <span class="mi">100</span><span class="p">)),</span> <span class="s2">"World"</span><span class="p">])</span>
</span><span id="line-2"><span class="gp">&gt;&gt;&gt; </span><span class="n">message</span><span class="o">.</span><span class="n">text</span>
</span><span id="line-3"><span class="go">'Hello\n&lt;image&gt;\nWorld'</span>
</span><span id="line-3"><span class="go">'Hello\n&lt;PilImage&gt;\nWorld'</span>
</span></code></pre></div>
</div>
</dd></dl>
Expand Down Expand Up @@ -555,6 +559,7 @@ <h3>Solving the parsing problem<a class="headerlink" href="#solving-the-parsing-
<li><a :data-current="activeSection === '#ell.Message'" class="reference internal" href="#ell.Message"><code class="docutils literal notranslate"><span class="pre">Message</span></code></a></li>
<li><a :data-current="activeSection === '#ell.ContentBlock'" class="reference internal" href="#ell.ContentBlock"><code class="docutils literal notranslate"><span class="pre">ContentBlock</span></code></a><ul>
<li><a :data-current="activeSection === '#ell.ContentBlock.serialize_parsed'" class="reference internal" href="#ell.ContentBlock.serialize_parsed"><code class="docutils literal notranslate"><span class="pre">ContentBlock.serialize_parsed()</span></code></a></li>
<li><a :data-current="activeSection === '#ell.ContentBlock.content'" class="reference internal" href="#ell.ContentBlock.content"><code class="docutils literal notranslate"><span class="pre">ContentBlock.content</span></code></a></li>
</ul>
</li>
<li><a :data-current="activeSection === '#solving-the-construction-problem'" class="reference internal" href="#solving-the-construction-problem">Solving the construction problem</a><ul>
Expand Down
2 changes: 2 additions & 0 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ <h2 id="C">C</h2>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul style="margin-left:0;list-style-type:none">
<li><a href="core_concepts/ell_complex.html#ell.complex">complex() (in module ell)</a>
</li>
<li><a href="core_concepts/message_api.html#ell.ContentBlock.content">content (ell.ContentBlock property)</a>
</li>
</ul></td>
</tr>
Expand Down
Binary file modified objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 8dcf451

Please sign in to comment.