You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should create a lazy collection that creates new instances of an item using GPT-3. This should be a class that extends the base Larave LazyCollectiont to add methods for adding seed data, a prompt as well as various options.
This is a general-purpose version of #2, in fact, we could even build the model factory on top of this collection.
Options and Settings
These are the options and settings the lazy collection will need.
Query|Collection|Closure $seed - The seed data that we'll pass to GPT-3. In the case of a closure, we'll call it for each call to GPT-3 so the data is always unique.
int $chunkSize - we might need to give this a different name. The chunk is how many items we'll get from GPT-3 with each request.
array $gpt3Options - an array of GPT-3 options.
Closure $itemToString - a closure that converts an item (usually a seed item) into a string for GPT-3.
Closure $stringToItem - a closure that converts a string from GPT-3 back into a item (Model, Object, array, etc)
string $itemSeparator - a string used to separate item instances.
string $prompt - The prompt string for GPT-3.
Adding Seed Data
The user should be able to set the seed data in a constructor in a separate withSeed.
Using a Closure for Seed data
Here's an example of creating a generator that is seeded with 10 random items from a collection each time its run:
We should create a lazy collection that creates new instances of an item using GPT-3. This should be a class that extends the base Larave
LazyCollectiont
to add methods for adding seed data, a prompt as well as various options.This is a general-purpose version of #2, in fact, we could even build the model factory on top of this collection.
Options and Settings
These are the options and settings the lazy collection will need.
Query|Collection|Closure $seed
- The seed data that we'll pass to GPT-3. In the case of a closure, we'll call it for each call to GPT-3 so the data is always unique.int $chunkSize
- we might need to give this a different name. The chunk is how many items we'll get from GPT-3 with each request.array $gpt3Options
- an array of GPT-3 options.Closure $itemToString
- a closure that converts an item (usually a seed item) into a string for GPT-3.Closure $stringToItem
- a closure that converts a string from GPT-3 back into a item (Model, Object, array, etc)string $itemSeparator
- a string used to separate item instances.string $prompt
- The prompt string for GPT-3.Adding Seed Data
The user should be able to set the seed data in a constructor in a separate
withSeed
.Using a Closure for Seed data
Here's an example of creating a generator that is seeded with 10 random items from a collection each time its run:
This, along with a higher
temperature
setting for GPT-3, should ensure a lot of variety in the results.The text was updated successfully, but these errors were encountered: