Skip to content

Commit

Permalink
deploy: 31b30f8
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 29, 2024
1 parent 3089790 commit c6189a1
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
Binary file modified .doctrees/apis/datasets/datasets.types.doctree
Binary file not shown.
Binary file modified .doctrees/apis/datasets/index.doctree
Binary file not shown.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/tutorials/base_data_class.doctree
Binary file not shown.
4 changes: 2 additions & 2 deletions _sources/tutorials/base_data_class.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ DataClass
In LLM applications, data constantly needs to interact with LLMs in the form of strings via prompt and be parsed back to structured data from LLMs' text prediction.
:class:`DataClass<core.base_data_class.DataClass>` is designed to ease this data interaction with LLMs via prompt(input) and to parse the text prediction(output).
It is even more convenient to use together with :ref:`components-output_parser_note`.
It is even more convenient to use together with :doc:`Parser<output_parsers>` to parse the output from LLMs.

.. figure:: /_static/images/dataclass.png
:align: center
Expand Down Expand Up @@ -75,7 +75,7 @@ We also made the effort to provide more control:
2. **Signal the output/input fields.** We allow you to use ``__output_fields__`` and ``__input_fields__`` to explicitly signal the output and input fields. (1) It can be a subset of the fields in the data class. (2) You can specify the ordering in the `__output_fields__`.
3. **Exclude some fields from the output.** All serialization methods support `exclude` parameter to exclude some fields even for nested dataclasses.
4. **Allow nested dataclasses, lists, and dictionaries.** All methods support nested dataclasses, lists, and dictionaries.
5. **Easy to use with Output parser.** It works well with output parsers such as ``JsonOutputParser``, ``YamlOutputParser``, and ``DataClassParser``. You can refer to :ref:`components-output_parser_note` for more details.
5. **Easy to use with Output parser.** It works well with output parsers such as ``JsonOutputParser``, ``YamlOutputParser``, and ``DataClassParser``. You can refer to :doc:`Parser<output_parsers>`for more details.


Describing the Data Format (Data Class)
Expand Down
12 changes: 6 additions & 6 deletions apis/datasets/datasets.types.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions apis/datasets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -624,12 +624,12 @@ <h2>Overview<a class="headerlink" href="#overview" title="Link to this heading">

<dl class="py class">
<dt class="sig sig-object py" id="datasets.Example">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">Example</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">id</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">'8e745a35-10fa-4dbb-8172-8a05a36b9485'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">question</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">answer</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/datasets/types.html#Example"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#datasets.Example" title="Link to this definition">#</a></dt>
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">Example</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">id</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">'a5cfe255-3ca5-4100-801f-829e6403a04f'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">question</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">answer</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/datasets/types.html#Example"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#datasets.Example" title="Link to this definition">#</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">DataClass</span></code></p>
<p>A common dataclass for representing examples in a dataset.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="datasets.Example.id">
<span class="sig-name descname"><span class="pre">id</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">str</span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'8e745a35-10fa-4dbb-8172-8a05a36b9485'</span></em><a class="headerlink" href="#datasets.Example.id" title="Link to this definition">#</a></dt>
<span class="sig-name descname"><span class="pre">id</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">str</span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'a5cfe255-3ca5-4100-801f-829e6403a04f'</span></em><a class="headerlink" href="#datasets.Example.id" title="Link to this definition">#</a></dt>
<dd></dd></dl>

<dl class="py attribute">
Expand All @@ -646,7 +646,7 @@ <h2>Overview<a class="headerlink" href="#overview" title="Link to this heading">

<dl class="py class">
<dt class="sig sig-object py" id="datasets.HotPotQAData">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">HotPotQAData</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">id</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">'8e745a35-10fa-4dbb-8172-8a05a36b9485'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">question</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">answer</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">gold_titles</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">set</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><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/datasets/types.html#HotPotQAData"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#datasets.HotPotQAData" title="Link to this definition">#</a></dt>
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">HotPotQAData</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">id</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">'a5cfe255-3ca5-4100-801f-829e6403a04f'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">question</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">answer</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">gold_titles</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">set</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><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/datasets/types.html#HotPotQAData"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#datasets.HotPotQAData" title="Link to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="datasets.types.html#datasets.types.Example" title="datasets.types.Example"><code class="xref py py-class docutils literal notranslate"><span class="pre">Example</span></code></a></p>
<p>A dataclass for representing examples in the HotPotQA dataset.</p>
<dl class="py attribute">
Expand All @@ -671,7 +671,7 @@ <h2>Overview<a class="headerlink" href="#overview" title="Link to this heading">

<dl class="py class">
<dt class="sig sig-object py" id="datasets.TrecData">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">TrecData</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">id</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">'c3b00c76-dbf4-4e0f-a3aa-d690c6d7b4c0'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">question</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">class_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">class_index</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</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">-1</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/datasets/types.html#TrecData"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#datasets.TrecData" title="Link to this definition">#</a></dt>
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">TrecData</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">id</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">'8a59cb7b-fc6e-416e-9bee-eb19280ac59c'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">question</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">class_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">class_index</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</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">-1</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/datasets/types.html#TrecData"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#datasets.TrecData" title="Link to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="datasets.types.html#datasets.types.BaseData" title="datasets.types.BaseData"><code class="xref py py-class docutils literal notranslate"><span class="pre">BaseData</span></code></a></p>
<p>A dataclass for representing examples in the TREC dataset.</p>
<dl class="py attribute">
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions tutorials/base_data_class.html
Original file line number Diff line number Diff line change
Expand Up @@ -489,12 +489,12 @@
<h1>DataClass<a class="headerlink" href="#dataclass" title="Link to this heading">#</a></h1>
<p>In LLM applications, data constantly needs to interact with LLMs in the form of strings via prompt and be parsed back to structured data from LLMs’ text prediction.
<a class="reference internal" href="../apis/core/core.base_data_class.html#core.base_data_class.DataClass" title="core.base_data_class.DataClass"><code class="xref py py-class docutils literal notranslate"><span class="pre">DataClass</span></code></a> is designed to ease this data interaction with LLMs via prompt(input) and to parse the text prediction(output).
It is even more convenient to use together with <span class="xref std std-ref">components-output_parser_note</span>.</p>
<figure class="align-center" id="id1">
It is even more convenient to use together with <a class="reference internal" href="output_parsers.html"><span class="doc">Parser</span></a> to parse the output from LLMs.</p>
<figure class="align-center" id="id3">
<a class="reference internal image-reference" href="../_images/dataclass.png"><img alt="DataClass" src="../_images/dataclass.png" style="width: 680px;" />
</a>
<figcaption>
<p><span class="caption-text">DataClass is to ease the data interaction with LLMs.</span><a class="headerlink" href="#id1" title="Link to this image">#</a></p>
<p><span class="caption-text">DataClass is to ease the data interaction with LLMs.</span><a class="headerlink" href="#id3" title="Link to this image">#</a></p>
</figcaption>
</figure>
<section id="design">
Expand Down Expand Up @@ -537,7 +537,7 @@ <h2>Design<a class="headerlink" href="#design" title="Link to this heading">#</a
<li><p><strong>Signal the output/input fields.</strong> We allow you to use <code class="docutils literal notranslate"><span class="pre">__output_fields__</span></code> and <code class="docutils literal notranslate"><span class="pre">__input_fields__</span></code> to explicitly signal the output and input fields. (1) It can be a subset of the fields in the data class. (2) You can specify the ordering in the <cite>__output_fields__</cite>.</p></li>
<li><p><strong>Exclude some fields from the output.</strong> All serialization methods support <cite>exclude</cite> parameter to exclude some fields even for nested dataclasses.</p></li>
<li><p><strong>Allow nested dataclasses, lists, and dictionaries.</strong> All methods support nested dataclasses, lists, and dictionaries.</p></li>
<li><p><strong>Easy to use with Output parser.</strong> It works well with output parsers such as <code class="docutils literal notranslate"><span class="pre">JsonOutputParser</span></code>, <code class="docutils literal notranslate"><span class="pre">YamlOutputParser</span></code>, and <code class="docutils literal notranslate"><span class="pre">DataClassParser</span></code>. You can refer to <span class="xref std std-ref">components-output_parser_note</span> for more details.</p></li>
<li><p><strong>Easy to use with Output parser.</strong> It works well with output parsers such as <code class="docutils literal notranslate"><span class="pre">JsonOutputParser</span></code>, <code class="docutils literal notranslate"><span class="pre">YamlOutputParser</span></code>, and <code class="docutils literal notranslate"><span class="pre">DataClassParser</span></code>. You can refer to :doc:<a href="#id1"><span class="problematic" id="id2">`</span></a>Parser&lt;output_parsers&gt;`for more details.</p></li>
</ol>
<section id="describing-the-data-format-data-class">
<h3>Describing the Data Format (Data Class)<a class="headerlink" href="#describing-the-data-format-data-class" title="Link to this heading">#</a></h3>
Expand Down

0 comments on commit c6189a1

Please sign in to comment.