Skip to content

Commit

Permalink
Built site for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Quarto GHA Workflow Runner committed Dec 5, 2024
1 parent d23e084 commit 9d29082
Show file tree
Hide file tree
Showing 19 changed files with 847 additions and 494 deletions.
2 changes: 1 addition & 1 deletion .nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
341b71bc
77fba409
2 changes: 1 addition & 1 deletion get-started.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ <h2 id="toc-title">On this page</h2>



<p>chatlas makes it easy to access to the wealth of large language models (LLMs) from Python. But what can you do with those models once you have access to them? This vignette will give you the basic vocabulary you need to use an LLM effectively and will show you some examples to ignite your creativity.</p>
<p>chatlas makes it easy to access the wealth of large language models (LLMs) from Python. But what can you do with those models once you have access to them? This vignette will give you the basic vocabulary you need to use an LLM effectively and will show you some examples to ignite your creativity.</p>
<p>In this article we’ll mostly ignore how LLMs work, using them as convenient black boxes. If you want to get a sense of how they actually work, we recommend watching Jeremy Howard’s posit::conf(2023) keynote: <a href="https://www.youtube.com/watch?v=sYliwvml9Es">A hacker’s guide to open source LLMs</a>.</p>
<section id="vocabulary" class="level2">
<h2 class="anchored" data-anchor-id="vocabulary">Vocabulary</h2>
Expand Down
124 changes: 91 additions & 33 deletions index.html

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions objects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ chatlas.Chat.chat_async py:function 1 reference/Chat.html#chatlas.Chat.chat_asyn
chatlas._chat.Chat.chat_async py:function 1 reference/Chat.html#chatlas.Chat.chat_async chatlas.Chat.chat_async
chatlas.Chat.console py:function 1 reference/Chat.html#chatlas.Chat.console -
chatlas._chat.Chat.console py:function 1 reference/Chat.html#chatlas.Chat.console chatlas.Chat.console
chatlas.Chat.export py:function 1 reference/Chat.html#chatlas.Chat.export -
chatlas._chat.Chat.export py:function 1 reference/Chat.html#chatlas.Chat.export chatlas.Chat.export
chatlas.Chat.extract_data py:function 1 reference/Chat.html#chatlas.Chat.extract_data -
chatlas._chat.Chat.extract_data py:function 1 reference/Chat.html#chatlas.Chat.extract_data chatlas.Chat.extract_data
chatlas.Chat.extract_data_async py:function 1 reference/Chat.html#chatlas.Chat.extract_data_async -
Expand Down
372 changes: 184 additions & 188 deletions prompt-design.html

Large diffs are not rendered by default.

280 changes: 187 additions & 93 deletions reference/Chat.html

Large diffs are not rendered by default.

18 changes: 5 additions & 13 deletions reference/Turn.html
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,7 @@ <h2 id="toc-title">On this page</h2>

<section id="chatlas.Turn" class="level1">
<h1>Turn</h1>
<div class="sourceCode" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>Turn(</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> <span class="va">self</span>,</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a> role,</span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a> contents,</span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a> <span class="op">*</span>,</span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a> tokens<span class="op">=</span>(<span class="dv">0</span>, <span class="dv">0</span>),</span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a> finish_reason<span class="op">=</span><span class="va">None</span>,</span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a> completion<span class="op">=</span><span class="va">None</span>,</span>
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>Turn(<span class="va">self</span>, role, contents, <span class="op">*</span>, tokens<span class="op">=</span><span class="va">None</span>, finish_reason<span class="op">=</span><span class="va">None</span>, completion<span class="op">=</span><span class="va">None</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>A user or assistant turn</p>
<p>Every conversation with a chatbot consists of pairs of user and assistant turns, corresponding to an HTTP request and response. These turns are represented by the <code>Turn</code> object, which contains a list of <a href="../reference/types.Content.html#chatlas.types.Content"><code>Content</code></a>s representing the individual messages within the turn. These might be text, images, tool requests (assistant only), or tool responses (user only).</p>
<p>Note that a call to <code>.chat()</code> and related functions may result in multiple user-assistant turn cycles. For example, if you have registered tools, chatlas will automatically handle the tool calling loop, which may result in any number of additional cycles.</p>
Expand Down Expand Up @@ -564,7 +556,7 @@ <h2 class="doc-section doc-section-parameters anchored" data-anchor-id="paramete
<tbody>
<tr class="odd">
<td>role</td>
<td><a href="https://docs.python.org/3/library/stdtypes.html#str">str</a></td>
<td><a href="https://docs.python.org/3/library/typing.html#typing.Literal">Literal</a>['user', 'assistant', 'system']</td>
<td>Either “user”, “assistant”, or “system”.</td>
<td><em>required</em></td>
</tr>
Expand All @@ -576,13 +568,13 @@ <h2 class="doc-section doc-section-parameters anchored" data-anchor-id="paramete
</tr>
<tr class="odd">
<td>tokens</td>
<td><a href="https://docs.python.org/3/library/stdtypes.html#tuple">tuple</a>[<a href="https://docs.python.org/3/library/functions.html#int">int</a>, <a href="https://docs.python.org/3/library/functions.html#int">int</a>]</td>
<td><a href="https://docs.python.org/3/library/typing.html#typing.Optional">Optional</a>[<a href="https://docs.python.org/3/library/stdtypes.html#tuple">tuple</a>[<a href="https://docs.python.org/3/library/functions.html#int">int</a>, <a href="https://docs.python.org/3/library/functions.html#int">int</a>]]</td>
<td>A numeric vector of length 2 representing the number of input and output tokens (respectively) used in this turn. Currently only recorded for assistant turns.</td>
<td><code>(0, 0)</code></td>
<td><code>None</code></td>
</tr>
<tr class="even">
<td>finish_reason</td>
<td><a href="https://docs.python.org/3/library/stdtypes.html#str">str</a> | None</td>
<td><a href="https://docs.python.org/3/library/typing.html#typing.Optional">Optional</a>[<a href="https://docs.python.org/3/library/stdtypes.html#str">str</a>]</td>
<td>A string indicating the reason why the conversation ended. This is only relevant for assistant turns.</td>
<td><code>None</code></td>
</tr>
Expand Down
14 changes: 7 additions & 7 deletions reference/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -642,31 +642,31 @@ <h2 class="anchored" data-anchor-id="user-facing-types">User-facing types</h2>
</tr>
<tr class="even">
<td><a href="../reference/types.ContentImage.html#chatlas.types.ContentImage">types.ContentImage</a></td>
<td></td>
<td>Base class for image content.</td>
</tr>
<tr class="odd">
<td><a href="../reference/types.ContentImageInline.html#chatlas.types.ContentImageInline">types.ContentImageInline</a></td>
<td></td>
<td>Inline image content.</td>
</tr>
<tr class="even">
<td><a href="../reference/types.ContentImageRemote.html#chatlas.types.ContentImageRemote">types.ContentImageRemote</a></td>
<td></td>
<td>Image content from a URL.</td>
</tr>
<tr class="odd">
<td><a href="../reference/types.ContentJson.html#chatlas.types.ContentJson">types.ContentJson</a></td>
<td></td>
<td>JSON content</td>
</tr>
<tr class="even">
<td><a href="../reference/types.ContentText.html#chatlas.types.ContentText">types.ContentText</a></td>
<td></td>
<td>Text content for a <a href="../reference/Turn.html#chatlas.Turn"><code>Turn</code></a></td>
</tr>
<tr class="odd">
<td><a href="../reference/types.ContentToolRequest.html#chatlas.types.ContentToolRequest">types.ContentToolRequest</a></td>
<td></td>
<td>A request to call a tool/function</td>
</tr>
<tr class="even">
<td><a href="../reference/types.ContentToolResult.html#chatlas.types.ContentToolResult">types.ContentToolResult</a></td>
<td></td>
<td>The result of calling a tool/function</td>
</tr>
<tr class="odd">
<td><a href="../reference/types.ChatResponse.html#chatlas.types.ChatResponse">types.ChatResponse</a></td>
Expand Down
2 changes: 2 additions & 0 deletions reference/types.ContentImage.html
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ <h2 id="toc-title">On this page</h2>
<section id="chatlas.types.ContentImage" class="level1">
<h1>types.ContentImage</h1>
<div class="sourceCode" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>types.ContentImage()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>Base class for image content.</p>
<p>This class is not meant to be used directly. Instead, use <a href="../reference/content_image_url.html#chatlas.content_image_url"><code>content_image_url</code></a>, <a href="../reference/content_image_file.html#chatlas.content_image_file"><code>content_image_file</code></a>, or <a href="../reference/content_image_plot.html#chatlas.content_image_plot"><code>content_image_plot</code></a>.</p>


</section>
Expand Down
34 changes: 33 additions & 1 deletion reference/types.ContentImageInline.html
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,10 @@
<h2 id="toc-title">On this page</h2>

<ul>
<li><a href="#chatlas.types.ContentImageInline" id="toc-chatlas.types.ContentImageInline" class="nav-link active" data-scroll-target="#chatlas.types.ContentImageInline">types.ContentImageInline</a></li>
<li><a href="#chatlas.types.ContentImageInline" id="toc-chatlas.types.ContentImageInline" class="nav-link active" data-scroll-target="#chatlas.types.ContentImageInline">types.ContentImageInline</a>
<ul class="collapse">
<li><a href="#parameters" id="toc-parameters" class="nav-link" data-scroll-target="#parameters">Parameters</a></li>
</ul></li>
</ul>
<div class="toc-actions"><ul><li><a href="https://github.com/posit-dev/chatlas/issues/new" class="toc-action"><i class="bi bi-github"></i>Report an issue</a></li><li><a href="https://github.com/posit-dev/chatlas/blob/main/reference/types.ContentImageInline.qmd" class="toc-action"><i class="bi empty"></i>View source</a></li></ul></div></nav>
</div>
Expand All @@ -518,8 +521,37 @@ <h2 id="toc-title">On this page</h2>
<section id="chatlas.types.ContentImageInline" class="level1">
<h1>types.ContentImageInline</h1>
<div class="sourceCode" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>types.ContentImageInline(<span class="va">self</span>, content_type, data<span class="op">=</span><span class="va">None</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>Inline image content.</p>
<p>This is the return type for <a href="../reference/content_image_file.html#chatlas.content_image_file"><code>content_image_file</code></a> and <a href="../reference/content_image_plot.html#chatlas.content_image_plot"><code>content_image_plot</code></a>. It’s not meant to be used directly.</p>
<section id="parameters" class="level2 doc-section doc-section-parameters">
<h2 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters">Parameters</h2>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>content_type</td>
<td><a href="../reference/types.ImageContentTypes.html#chatlas.types.ImageContentTypes">ImageContentTypes</a></td>
<td>The content type of the image.</td>
<td><em>required</em></td>
</tr>
<tr class="even">
<td>data</td>
<td><a href="https://docs.python.org/3/library/typing.html#typing.Optional">Optional</a>[<a href="https://docs.python.org/3/library/stdtypes.html#str">str</a>]</td>
<td>The base64-encoded image data.</td>
<td><code>None</code></td>
</tr>
</tbody>
</table>


</section>
</section>

</main> <!-- /main -->
Expand Down
36 changes: 34 additions & 2 deletions reference/types.ContentImageRemote.html
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,10 @@
<h2 id="toc-title">On this page</h2>

<ul>
<li><a href="#chatlas.types.ContentImageRemote" id="toc-chatlas.types.ContentImageRemote" class="nav-link active" data-scroll-target="#chatlas.types.ContentImageRemote">types.ContentImageRemote</a></li>
<li><a href="#chatlas.types.ContentImageRemote" id="toc-chatlas.types.ContentImageRemote" class="nav-link active" data-scroll-target="#chatlas.types.ContentImageRemote">types.ContentImageRemote</a>
<ul class="collapse">
<li><a href="#parameters" id="toc-parameters" class="nav-link" data-scroll-target="#parameters">Parameters</a></li>
</ul></li>
</ul>
<div class="toc-actions"><ul><li><a href="https://github.com/posit-dev/chatlas/issues/new" class="toc-action"><i class="bi bi-github"></i>Report an issue</a></li><li><a href="https://github.com/posit-dev/chatlas/blob/main/reference/types.ContentImageRemote.qmd" class="toc-action"><i class="bi empty"></i>View source</a></li></ul></div></nav>
</div>
Expand All @@ -517,9 +520,38 @@ <h2 id="toc-title">On this page</h2>

<section id="chatlas.types.ContentImageRemote" class="level1">
<h1>types.ContentImageRemote</h1>
<div class="sourceCode" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>types.ContentImageRemote(<span class="va">self</span>, url, detail<span class="op">=</span><span class="st">''</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>types.ContentImageRemote(<span class="va">self</span>, url, detail<span class="op">=</span><span class="st">'auto'</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>Image content from a URL.</p>
<p>This is the return type for <a href="../reference/content_image_url.html#chatlas.content_image_url"><code>content_image_url</code></a>. It’s not meant to be used directly.</p>
<section id="parameters" class="level2 doc-section doc-section-parameters">
<h2 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters">Parameters</h2>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>url</td>
<td><a href="https://docs.python.org/3/library/stdtypes.html#str">str</a></td>
<td>The URL of the image.</td>
<td><em>required</em></td>
</tr>
<tr class="even">
<td>detail</td>
<td><a href="https://docs.python.org/3/library/typing.html#typing.Literal">Literal</a>['auto', 'low', 'high']</td>
<td>A detail setting for the image. Can be <code>"auto"</code>, <code>"low"</code>, or <code>"high"</code>.</td>
<td><code>'auto'</code></td>
</tr>
</tbody>
</table>


</section>
</section>

</main> <!-- /main -->
Expand Down
28 changes: 27 additions & 1 deletion reference/types.ContentJson.html
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,10 @@
<h2 id="toc-title">On this page</h2>

<ul>
<li><a href="#chatlas.types.ContentJson" id="toc-chatlas.types.ContentJson" class="nav-link active" data-scroll-target="#chatlas.types.ContentJson">types.ContentJson</a></li>
<li><a href="#chatlas.types.ContentJson" id="toc-chatlas.types.ContentJson" class="nav-link active" data-scroll-target="#chatlas.types.ContentJson">types.ContentJson</a>
<ul class="collapse">
<li><a href="#parameters" id="toc-parameters" class="nav-link" data-scroll-target="#parameters">Parameters</a></li>
</ul></li>
</ul>
<div class="toc-actions"><ul><li><a href="https://github.com/posit-dev/chatlas/issues/new" class="toc-action"><i class="bi bi-github"></i>Report an issue</a></li><li><a href="https://github.com/posit-dev/chatlas/blob/main/reference/types.ContentJson.qmd" class="toc-action"><i class="bi empty"></i>View source</a></li></ul></div></nav>
</div>
Expand All @@ -518,8 +521,31 @@ <h2 id="toc-title">On this page</h2>
<section id="chatlas.types.ContentJson" class="level1">
<h1>types.ContentJson</h1>
<div class="sourceCode" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>types.ContentJson(<span class="va">self</span>, value)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>JSON content</p>
<p>This content type primarily exists to signal structured data extraction (i.e., data extracted via <a href="../reference/Chat.html#chatlas.Chat"><code>Chat</code></a>’s <code>.extract_data()</code> method)</p>
<section id="parameters" class="level2 doc-section doc-section-parameters">
<h2 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters">Parameters</h2>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>value</td>
<td><a href="https://docs.python.org/3/library/stdtypes.html#dict">dict</a>[<a href="https://docs.python.org/3/library/stdtypes.html#str">str</a>, <a href="https://docs.python.org/3/library/typing.html#typing.Any">Any</a>]</td>
<td>The JSON data extracted</td>
<td><em>required</em></td>
</tr>
</tbody>
</table>


</section>
</section>

</main> <!-- /main -->
Expand Down
1 change: 1 addition & 0 deletions reference/types.ContentText.html
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ <h2 id="toc-title">On this page</h2>
<section id="chatlas.types.ContentText" class="level1">
<h1>types.ContentText</h1>
<div class="sourceCode" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>types.ContentText(<span class="va">self</span>, text)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>Text content for a <a href="../reference/Turn.html#chatlas.Turn"><code>Turn</code></a></p>


</section>
Expand Down
Loading

0 comments on commit 9d29082

Please sign in to comment.