DotnetPrompt.LLM.OpenAI
1.0.0-alpha.2.1
dotnet add package DotnetPrompt.LLM.OpenAI --version 1.0.0-alpha.2.1
NuGet\Install-Package DotnetPrompt.LLM.OpenAI -Version 1.0.0-alpha.2.1
<PackageReference Include="DotnetPrompt.LLM.OpenAI" Version="1.0.0-alpha.2.1" />
paket add DotnetPrompt.LLM.OpenAI --version 1.0.0-alpha.2.1
#r "nuget: DotnetPrompt.LLM.OpenAI, 1.0.0-alpha.2.1"
// Install DotnetPrompt.LLM.OpenAI as a Cake Addin #addin nuget:?package=DotnetPrompt.LLM.OpenAI&version=1.0.0-alpha.2.1&prerelease // Install DotnetPrompt.LLM.OpenAI as a Cake Tool #tool nuget:?package=DotnetPrompt.LLM.OpenAI&version=1.0.0-alpha.2.1&prerelease
Quick Start
DotnetPrompt is a dotnet library that provides tools for working with Large Language Models (LLMs) individually and combined in chains. Our library helps you integrate LLMs with other tools and resources to create powerful AI applications.
To get started, add NuGet meta-package
> dotnet add package DotnetPrompt.All --version 1.0.0-alpha.1
For example, let's say we want to create a ModelChain
that takes user message, formats it with a PromptTemplate
,
and sends it to an ChatGPT
LLM to generate funny responses to the message. This allows us to generate a response based on the user's input.
Note: For that example to work you would need OpenAI API key.
var llm = new ChatGptModel(Constants.OpenAIKey, ChatGptModelConfiguration.Default with
{
Temperature = 0.9f
});
var oneInputPrompt = new PromptTemplate("What's a funny response to '{message}'");
var chain = new ModelChain(oneInputPrompt, llm);
var executor = chain.GetExecutor();
Now we can run that chain only specifying input value.
var result = await executor.PromptAsync("I have some exciting news to share with you!");
Console.WriteLine(result);
> I hope it's not that you finally learned how to tie your shoes, because that's not that exciting.
Or with another input
var result2 = await executor.PromptAsync("Want to grab lunch later?");
Console.WriteLine(result2);
> I would, but I'm on a "seefood" diet - I see food and I eat it. So better not tempt me!
What is this?
Welcome to our library, which is designed to support the development of cutting-edge applications powered by Large Language Models (LLMs) in dotnet.
As you may know, LLMs are an exciting and rapidly-evolving technology that offers developers unprecedented natural language processing and generation capabilities. However, LLMs can achieve their full potential when used in conjunction with other sources of computation or knowledge.
Some examples of solutions that you could create using our library include:
- Summarization
- Question Answering
- Code Generation
- Chatbots
- and much more
Documentation
Please see the full documentation on:
- Getting started (installation, setting up the environment, simple examples)
- How-To examples (demos, integrations, helper functions)
- Reference (full API docs)
- Resources (high-level explanation of core concepts)
Links
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. |
-
net6.0
- AI.Dev.OpenAI.GPT (>= 1.0.2)
- Azure.AI.OpenAI (>= 1.0.0-beta.4)
- DotnetPrompt.Abstractions (>= 1.0.0-alpha.2)
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DotnetPrompt.LLM.OpenAI:
Package | Downloads |
---|---|
DotnetPrompt.All
DotnetPrompt is a dotnet library that provides a set of tools for working with Large Language Models (LLMs) combined in chains. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0-alpha.2.1 | 141 | 3/18/2023 |
1.0.0-alpha.2 | 124 | 3/18/2023 |
1.0.0-alpha.1 | 117 | 3/3/2023 |