Skip to content

Commit

Permalink
deploy: e742b53
Browse files Browse the repository at this point in the history
  • Loading branch information
MadcowD committed Sep 12, 2024
1 parent 2261b68 commit 1bda62b
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 14 deletions.
4 changes: 2 additions & 2 deletions _sources/core_concepts/ell_complex.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The basic usage of ``@ell.complex`` is similar to ``@ell.simple``, but with enha
return f"Generate a review for the movie {movie}"
review_message = generate_movie_review("The Matrix")
review = review_message.parsed[0]
review = review_message.parsed
print(f"Movie: {review.title}, Rating: {review.rating}/10")
print(f"Summary: {review.summary}")
Expand All @@ -51,7 +51,7 @@ Key Features
return f"Generate a review for the movie {movie}"
review_message = generate_movie_review("Inception")
review = review_message.parsed[0]
review = review_message.parsed
print(f"Rating: {review.rating}/10")
2. Multimodal Interactions
Expand Down
2 changes: 1 addition & 1 deletion _sources/core_concepts/structured_outputs.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Once we have defined and generated structured outputs, we can easily access and
# Generate a movie review
message = generate_movie_review("The Matrix")
review = message.parsed[0]
review = message.parsed
# Access individual fields
print(f"Movie Title: {review.title}")
Expand Down
40 changes: 37 additions & 3 deletions core_concepts/configuration.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions core_concepts/ell_complex.html
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ <h2>Usage<a class="headerlink" href="#usage" title="Link to this heading" x-inte
</span><span id="line-12"> <span class="k">return</span> <span class="sa">f</span><span class="s2">"Generate a review for the movie </span><span class="si">{</span><span class="n">movie</span><span class="si">}</span><span class="s2">"</span>
</span><span id="line-13">
</span><span id="line-14"><span class="n">review_message</span> <span class="o">=</span> <span class="n">generate_movie_review</span><span class="p">(</span><span class="s2">"The Matrix"</span><span class="p">)</span>
</span><span id="line-15"><span class="n">review</span> <span class="o">=</span> <span class="n">review_message</span><span class="o">.</span><span class="n">parsed</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
</span><span id="line-15"><span class="n">review</span> <span class="o">=</span> <span class="n">review_message</span><span class="o">.</span><span class="n">parsed</span>
</span><span id="line-16"><span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Movie: </span><span class="si">{</span><span class="n">review</span><span class="o">.</span><span class="n">title</span><span class="si">}</span><span class="s2">, Rating: </span><span class="si">{</span><span class="n">review</span><span class="o">.</span><span class="n">rating</span><span class="si">}</span><span class="s2">/10"</span><span class="p">)</span>
</span><span id="line-17"><span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Summary: </span><span class="si">{</span><span class="n">review</span><span class="o">.</span><span class="n">summary</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
</span></code></pre></div>
Expand All @@ -274,7 +274,7 @@ <h3>1. Structured Outputs<a class="headerlink" href="#structured-outputs" title=
</span><span id="line-4"> <span class="k">return</span> <span class="sa">f</span><span class="s2">"Generate a review for the movie </span><span class="si">{</span><span class="n">movie</span><span class="si">}</span><span class="s2">"</span>
</span><span id="line-5">
</span><span id="line-6"><span class="n">review_message</span> <span class="o">=</span> <span class="n">generate_movie_review</span><span class="p">(</span><span class="s2">"Inception"</span><span class="p">)</span>
</span><span id="line-7"><span class="n">review</span> <span class="o">=</span> <span class="n">review_message</span><span class="o">.</span><span class="n">parsed</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
</span><span id="line-7"><span class="n">review</span> <span class="o">=</span> <span class="n">review_message</span><span class="o">.</span><span class="n">parsed</span>
</span><span id="line-8"><span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Rating: </span><span class="si">{</span><span class="n">review</span><span class="o">.</span><span class="n">rating</span><span class="si">}</span><span class="s2">/10"</span><span class="p">)</span>
</span></code></pre></div>
</div>
Expand Down Expand Up @@ -348,7 +348,7 @@ <h3>4. Tool Usage<a class="headerlink" href="#tool-usage" title="Link to this he
<h2>Reference<a class="headerlink" href="#reference" title="Link to this heading" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#reference'"></a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="ell.complex">
<span class="sig-prename descclassname"><span class="pre">ell.</span></span><span class="sig-name descname"><span class="pre">complex</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">model</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">OpenAI</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exempt_from_tracking</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tools</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">Callable</span><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">post_callback</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">api_params</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#ell.complex" title="Link to this definition" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#ell.complex'"></a></dt>
<span class="sig-prename descclassname"><span class="pre">ell.</span></span><span class="sig-name descname"><span class="pre">complex</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">model</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Any</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exempt_from_tracking</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tools</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">Callable</span><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">post_callback</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">api_params</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#ell.complex" title="Link to this definition" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#ell.complex'"></a></dt>
<dd><p>A sophisticated language model programming decorator for complex LLM interactions.</p>
<p>This decorator transforms a function into a Language Model Program (LMP) capable of handling
multi-turn conversations, tool usage, and various output formats. It’s designed for advanced
Expand Down
2 changes: 1 addition & 1 deletion core_concepts/ell_simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ <h2>What about multiturn conversations, tools, structured outputs, and other fea
<h2>Reference<a class="headerlink" href="#reference" title="Link to this heading" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#reference'"></a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="ell.simple">
<span class="sig-prename descclassname"><span class="pre">ell.</span></span><span class="sig-name descname"><span class="pre">simple</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">model</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">OpenAI</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exempt_from_tracking</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">api_params</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#ell.simple" title="Link to this definition" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#ell.simple'"></a></dt>
<span class="sig-prename descclassname"><span class="pre">ell.</span></span><span class="sig-name descname"><span class="pre">simple</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">model</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">client</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Any</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exempt_from_tracking</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">api_params</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#ell.simple" title="Link to this definition" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#ell.simple'"></a></dt>
<dd><p>The fundamental unit of language model programming in ell.</p>
<p>This decorator simplifies the process of creating Language Model Programs (LMPs)
that return text-only outputs from language models, while supporting multimodal inputs.
Expand Down
4 changes: 2 additions & 2 deletions core_concepts/message_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ <h2>The ell Message API<a class="headerlink" href="#the-ell-message-api" title="
<dd class="field-odd"><ul class="simple">
<li><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">audio</span> <span class="pre">(numpy.ndarray</span> <span class="pre">|</span> <span class="pre">List[float]</span> <span class="pre">|</span> <span class="pre">None)</span></code></p></li>
<li><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">image</span> <span class="pre">(PIL.Image.Image</span> <span class="pre">|</span> <span class="pre">str</span> <span class="pre">|</span> <span class="pre">numpy.ndarray</span> <span class="pre">|</span> <span class="pre">None)</span></code></p></li>
<li><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">parsed</span> <span class="pre">(Type[pydantic.main.BaseModel]</span> <span class="pre">|</span> <span class="pre">pydantic.main.BaseModel</span> <span class="pre">|</span> <span class="pre">None)</span></code></p></li>
<li><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">parsed</span> <span class="pre">(pydantic.main.BaseModel</span> <span class="pre">|</span> <span class="pre">None)</span></code></p></li>
<li><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">text</span> <span class="pre">(ell.types._lstr._lstr</span> <span class="pre">|</span> <span class="pre">str</span> <span class="pre">|</span> <span class="pre">None)</span></code></p></li>
<li><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tool_call</span> <span class="pre">(ell.types.message.ToolCall</span> <span class="pre">|</span> <span class="pre">None)</span></code></p></li>
<li><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tool_result</span> <span class="pre">(ell.types.message.ToolResult</span> <span class="pre">|</span> <span class="pre">None)</span></code></p></li>
Expand Down Expand Up @@ -474,7 +474,7 @@ <h3>Solving the parsing problem<a class="headerlink" href="#solving-the-parsing-
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="ell.Message.parsed">
<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">parsed</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">BaseModel</span><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#ell.Message.parsed" title="Link to this definition" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#ell.Message.parsed'"></a></dt>
<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">parsed</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">BaseModel</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">BaseModel</span><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#ell.Message.parsed" title="Link to this definition" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#ell.Message.parsed'"></a></dt>
<dd><p>Returns a list of all parsed content.</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="k">class</span> <span class="nc">CustomModel</span><span class="p">(</span><span class="n">BaseModel</span><span class="p">):</span>
Expand Down
2 changes: 1 addition & 1 deletion core_concepts/structured_outputs.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ <h1>Structured Outputs<a class="headerlink" href="#structured-outputs" title="Li
<p>Once we have defined and generated structured outputs, we can easily access and manipulate the data within them. Let’s continue with our movie review example to demonstrate how to work with structured outputs:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><code><span id="line-1"><span class="c1"># Generate a movie review</span>
</span><span id="line-2"><span class="n">message</span> <span class="o">=</span> <span class="n">generate_movie_review</span><span class="p">(</span><span class="s2">"The Matrix"</span><span class="p">)</span>
</span><span id="line-3"><span class="n">review</span> <span class="o">=</span> <span class="n">message</span><span class="o">.</span><span class="n">parsed</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
</span><span id="line-3"><span class="n">review</span> <span class="o">=</span> <span class="n">message</span><span class="o">.</span><span class="n">parsed</span>
</span><span id="line-4">
</span><span id="line-5"><span class="c1"># Access individual fields</span>
</span><span id="line-6"><span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Movie Title: </span><span class="si">{</span><span class="n">review</span><span class="o">.</span><span class="n">title</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
Expand Down
8 changes: 8 additions & 0 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ <h2 id="G">G</h2>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul style="margin-left:0;list-style-type:none">
<li><a href="core_concepts/configuration.html#ell.Config.get_provider_for">get_provider_for() (ell.Config method)</a>
</li>
<li><a href="core_concepts/configuration.html#ell.Config.get_store">get_store() (ell.Config method)</a>
</li>
</ul></td>
Expand Down Expand Up @@ -417,6 +419,10 @@ <h2 id="P">P</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul style="margin-left:0;list-style-type:none">
<li><a href="core_concepts/message_api.html#ell.Message.parsed">parsed (ell.Message property)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul style="margin-left:0;list-style-type:none">
<li><a href="core_concepts/configuration.html#ell.Config.providers">providers (ell.Config attribute)</a>
</li>
</ul></td>
</tr>
Expand All @@ -429,6 +435,8 @@ <h2 id="R">R</h2>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul style="margin-left:0;list-style-type:none">
<li><a href="core_concepts/configuration.html#ell.Config.register_provider">register_provider() (ell.Config method)</a>
</li>
<li><a href="core_concepts/configuration.html#ell.Config.reset">reset() (ell.Config method)</a>
</li>
</ul></td>
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 1bda62b

Please sign in to comment.