Imagine.NET
0.1.0
dotnet add package Imagine.NET --version 0.1.0
NuGet\Install-Package Imagine.NET -Version 0.1.0
<PackageReference Include="Imagine.NET" Version="0.1.0" />
<PackageVersion Include="Imagine.NET" Version="0.1.0" />
<PackageReference Include="Imagine.NET" />
paket add Imagine.NET --version 0.1.0
#r "nuget: Imagine.NET, 0.1.0"
#:package Imagine.NET@0.1.0
#addin nuget:?package=Imagine.NET&version=0.1.0
#tool nuget:?package=Imagine.NET&version=0.1.0
Introduction
Imagine.NET is a .NET Core library that emulates an 'imaginary database' that allows you to query GPT with fluent LINQ to generate and transform data. It works seamlessly with .NET types and data structures to take full advantage of GPT's excellent zero-shot semantic understanding and completion, enabling simple but powerful data processing paradigms.
Why?
Most software works with structured data and predefined types at compile-time. However, it can be challenging to get such structured data in and out of GPT prompt chains. Imagine.NET lets you focus on describing your domain model in a fluent and declarative manner that is both familiar and productive. This project is used to power the 'imagination' and reasoning of AI agents like Cheevly.
Overview
Imagine.NET offers two types of processing pipelines.
Type + Prompt
Provide a .NET Type and a text prompt to get back a list of data that conforms to the prompt.
List + Type + Prompt
Provide a list of input data, a .NET Type and a text prompt and get back a new list of data derived from the list and prompt.
Getting started
Generate a list of 5 people whose first name start with 'b' and last name starts with 'd'
var imagination = new Imagination("GPT API KEY");
var results = imagination.Imagine<Person>(count: 5).Where(person => person.FirstName.StartsWith("b") && person.LastName.StartsWith("d")).ToList();
public class Person {
public string FirstName;
public string LastName;
public int Age;
}
Simulate a text conversation between a mother and child
var imagination = new Imagination("GPT API KEY");
var messages = imagination.Imagine<SMSMessage>("conversation between mother and child", 5).ToList();
public class SMSMessage {
public Person Sender;
public Person Recipient;
public string Text;
}
public class Person {
public string FirstName;
public string LastName;
public int Age;
}
Generate character abilities and then simulate a battle
var imagination = new Imagination("GPT API KEY");
var combatant1 = new Combatant { Name = "Josh", Description = "A master of canine magic" };
var combatant2 = new Combatant { Name = "Mack", Description = "A master of feline magic" };
// Lets imagine 5 abilities for combatant1
combatant1.Abilities = imagination.Imagine<Ability>(combatant1, count: 5).ToList();
// Now imagine 5 abilities for combatant2
combatant2.Abilities = imagination.Imagine<Ability>(combatant2, count: 5).ToList();
var combatants = new List<Combatant> { combatant1, combatant2 };
// Simulate 10 rounds of combat in the snow
var rounds = imagination.Imagine<CombatRound>(combatants, "snow", count: 10).ToList();
public class Combatant {
public string Name;
public string Description;
public List<Ability> Abilities;
}
public class Ability {
public string Name;
public string Description;
}
public class CombatRound {
public string Description;
}
| Combatant 1 | Combatant 2 |
|---|---|
Use cases
- Procedural content generation
- Data analysis
- Semantic reasoning
- ETL (extract-transform-load)
- Unit test data generation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- ExpressionToCodeLib (>= 3.5.0)
- Microsoft.CodeAnalysis.CSharp (>= 4.5.0)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 2,420 | 3/13/2023 |