Practical overview
When it fits
Use it when building a .NET application that needs language-model calls combined with conversation state or application-provided tools.
Who it is for
- C# and .NET developers building applications that call language models.
- Developers adding function selection, conversation context or tool workflows to a generative AI application.
Documented uses
- Send prompts to an OpenAI language model and receive responses.
- Maintain an in-memory conversation chain and refer to additional context through vector stores.
- Describe functions and parameters so model responses can identify a function call.
- Create prompt templates, sequence tools, or process data with a map-and-reduce tool.
Requirements & limits
The public repository specifies an MIT license. Its examples show an OpenAI API key supplied directly or through the OPENAI_API_KEY environment variable.
- The documented model connection is to OpenAI; the repository describes a default language model for that connection.
- Conversation chains are retained in memory, and the README mentions vector stores for additional context.
- The function toolset relies on functions supplied to the conversation; the README does not describe automatic access to arbitrary application functions.
- For sequential pipelines, the first tool may take multiple variables, but subsequent tools accept one input: the previous tool's result.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Send a prompt to an OpenAI language model
Create a language-model instance and request a response to a user message.
Before you start
- A .NET project using GenAI.NET.
- An OpenAI API key, supplied directly or through the OPENAI_API_KEY environment variable.
- The model identifier shown in the example: gpt-3.5-turbo-0613.
Steps
Create an OpenAILanguageModel with the model identifier and API key.
Create a ChatMessage with Role.user and the prompt text.
Call GetResponseAsync with the message sequence and temperature value 0.8.
Read response.Response as the reply.
Expected outcome
The example obtains a response from the language model for the supplied user message.
Guide limitations
- The recipe documents a direct language-model request; it does not document installation or project setup.
- The example uses the specific model identifier gpt-3.5-turbo-0613; no model compatibility details are provided.
Request a function call from an OpenAI language model
Describe a function and request that the model return function-call details for a user prompt.
Before you start
- A .NET project using GenAI.NET.
- An OpenAI API key, supplied directly or through the OPENAI_API_KEY environment variable.
- A function name, description, and parameter descriptions.
Steps
Create ParameterDescriptor entries for the function parameters, including descriptions and any optional type constraints.
Create a FunctionDescriptor using the function name, description, and parameter list.
Create an OpenAILanguageModel and a user ChatMessage containing the request.
Call GetResponseAsync with the message sequence, function descriptor sequence, and temperature value 0.8.
Inspect response.Type and response.Response for the function-call type and JSON function details.
Expected outcome
The example requests a function-call response containing function details as JSON.
Guide limitations
- The example requests and inspects a function call; it does not show executing the described function.
- The documentation does not guarantee that a model will return a function call for every prompt.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 17 October 2026
- Original website title
- AutomationAgent-AI/GenAI.NET · Official homepage title · retained in its source language

