Skip to content

Commit

Permalink
Do I need it?
Browse files Browse the repository at this point in the history
  • Loading branch information
vzakharov committed Oct 10, 2023
1 parent 71417e1 commit 9005bbb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@

*Note: For easier navigation and API reference, check out the [documentation](https://losideadores.github.io/almostmagic2/) page.*

## Do I need it?

Before diving into the technicalities of `almostmagic`, you might be wondering if you really need this package. After all, couldn't you just use the OpenAI SDK directly?

The answer depends on your specific needs and use case. Here are a few reasons why you might want to consider using `almostmagic`:

1. **Structured data generation**: The main selling point of `almostmagic` is its ability to generate structured data. Whether you need to generate an array of strings, a complex object with nested properties, or even a single value with a specific type, `almostmagic` has got you covered. This is particularly useful when you need to generate data that fits a specific schema or when you want to generate multiple related pieces of data in a single call.

2. **Ease of use**: `almostmagic` simplifies the process of generating structured data using OpenAI's language models. You can define the structure of the data you want to generate in a simple, intuitive way, and `almostmagic` will take care of the rest. This can save you a lot of time and effort compared to manually crafting prompts and parsing the responses from the OpenAI API.

3. **Type inference**: `almostmagic` automatically infers the types of the properties it's generating based on their descriptions. This can be a huge time-saver if you're working with TypeScript, as you don't have to manually define types for each property.

In summary, if you're looking for a way to generate structured data using OpenAI's language models that is easy to use, flexible, and TypeScript-friendly, `almostmagic` might be just what you need. However, if you need more control over the generation process or want to use features that are not supported by `almostmagic`, you might be better off using the OpenAI SDK directly.

## Installation

```bash
Expand Down
12 changes: 12 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@
<h2>almostmagic</h2></div>
<div class="tsd-panel tsd-typography"><a id="md:its-almost-magic" class="tsd-anchor"></a><h1><a href="#md:its-almost-magic">It’s almost magic!</a></h1><p><code>almostmagic</code> is a package that allows you to generate structured data using OpenAI&#39;s large language models (e.g. GPT-3.5/4). It&#39;s designed to be easy to use, with just one line of code needed in most cases, and highly compatible with TypeScript.</p>
<p><em>Note: For easier navigation and API reference, check out the <a href="https://losideadores.github.io/almostmagic2/">documentation</a> page.</em></p>
<a id="md:do-i-need-it" class="tsd-anchor"></a><h2><a href="#md:do-i-need-it">Do I need it?</a></h2><p>Before diving into the technicalities of <code>almostmagic</code>, you might be wondering if you really need this package. After all, couldn&#39;t you just use the OpenAI SDK directly?</p>
<p>The answer depends on your specific needs and use case. Here are a few reasons why you might want to consider using <code>almostmagic</code>:</p>
<ol>
<li><p><strong>Structured data generation</strong>: The main selling point of <code>almostmagic</code> is its ability to generate structured data. Whether you need to generate an array of strings, a complex object with nested properties, or even a single value with a specific type, <code>almostmagic</code> has got you covered. This is particularly useful when you need to generate data that fits a specific schema or when you want to generate multiple related pieces of data in a single call.</p>
</li>
<li><p><strong>Ease of use</strong>: <code>almostmagic</code> simplifies the process of generating structured data using OpenAI&#39;s language models. You can define the structure of the data you want to generate in a simple, intuitive way, and <code>almostmagic</code> will take care of the rest. This can save you a lot of time and effort compared to manually crafting prompts and parsing the responses from the OpenAI API.</p>
</li>
<li><p><strong>Type inference</strong>: <code>almostmagic</code> automatically infers the types of the properties it&#39;s generating based on their descriptions. This can be a huge time-saver if you&#39;re working with TypeScript, as you don&#39;t have to manually define types for each property.</p>
</li>
</ol>
<p>In summary, if you&#39;re looking for a way to generate structured data using OpenAI&#39;s language models that is easy to use, flexible, and TypeScript-friendly, <code>almostmagic</code> might be just what you need. However, if you need more control over the generation process or want to use features that are not supported by <code>almostmagic</code>, you might be better off using the OpenAI SDK directly.</p>
<a id="md:installation" class="tsd-anchor"></a><h2><a href="#md:installation">Installation</a></h2><pre><code class="language-bash"><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">install</span><span class="hl-1"> </span><span class="hl-2">almostmagic</span>
</code><button>Copy</button></pre>
<a id="md:usage" class="tsd-anchor"></a><h2><a href="#md:usage">Usage</a></h2><p>Here&#39;s a simple example of how you can use <code>almostmagic</code> to generate an article&#39;s title, intro, and outline based on a given topic:</p>
Expand Down Expand Up @@ -125,6 +136,7 @@ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon
<li><a href="#md:its-almost-magic"><span>It’s almost magic!</span></a></li>
<li>
<ul>
<li><a href="#md:do-i-need-it"><span>Do <wbr/>I need it?</span></a></li>
<li><a href="#md:installation"><span>Installation</span></a></li>
<li><a href="#md:usage"><span>Usage</span></a></li>
<li><a href="#md:generation-quality-and-other-openai-parameters"><span>Generation quality and other <wbr/>OpenAI parameters</span></a></li>
Expand Down

0 comments on commit 9005bbb

Please sign in to comment.