Class OpenAiInit
- Namespace
- BotManager.OpenAi.Expressions
- Assembly
- BotManager.OpenAi.dll
The OpenAI plugin will connect to the OpenAI api by using the ApiKey and allows you to run AI expressions like OpenAiChat.
Return type is null.
null:
{ "$OpenAiInit": { "ApiKey": { "$Env": "OPENAI_API_KEY" } } }
public sealed class OpenAiInit : IExpression
- Inheritance
-
OpenAiInit
- Implements
- Inherited Members
Constructors
OpenAiInit()
public OpenAiInit()
Properties
ApiKey
Gets and sets the OpenAI api key.
public IExpression? ApiKey { get; set; }
Property Value
Service
Gets the internal OpenAI service.
[JsonIgnore]
public OpenAIService Service { get; }
Property Value
- OpenAIService
Methods
ExecuteAsync(RuntimeContext, Type?)
Executes the expression in the given RuntimeContext. Please do not use this method to run an expression. Use ExecuteAsync(IExpression?) instead.
public Task<object?> ExecuteAsync(RuntimeContext context, Type? returnType)
Parameters
contextRuntimeContextThe current runtime context.
returnTypeTypeThe expected return type. Use
typeof(object)for a generic result. Usenullif you don't need the return value.