Divooka.Services.AIServices
Divooka.Services.AIServices.Advanced.ChatGPTAdvanced.ChatGPTSummarizeTable()
Divooka.Services.AIServices.LLM.Components.ChatMessage
Represents a standard LLM chat message.
Remarks
Notice this is per OpenAI standard and is not compatible with HuggingFace and ImageText-Text models.
Divooka.Services.AIServices.LLM.Components.ChatMessage.MessageType
Represents the type of message in a conversation.
Divooka.Services.AIServices.LLM.Components.ChatMessage.MessageType.Assistant
A message generated by the assistant.
Divooka.Services.AIServices.LLM.Components.ChatMessage.MessageType.User
A message sent by the user.
Divooka.Services.AIServices.LLM.Components.ChatMessage.MessageType.System
A system message
Divooka.Services.AIServices.LLM.DataStructure.LocalFileSystemVectorStoreHelper
Provides helper methods to generate vector embeddings from local file system text files.
Remarks
This helper class processes files that are assumed to be text files.
Divooka.Services.AIServices.LLM.DataStructure.LocalFileSystemVectorStoreHelper.GenerateVectorEmbeddings()
Generates vector embeddings for text files in the specified folder.
Remarks
This method retrieves all files matching the provided filePatterns from the sourceFolder, assuming that these files are text files. Each file's content is read and then converted to a vector embedding using OpenAIHelper.GetEmbedding().
Parameters
| Name | Description | Default |
|---|---|---|
sourceFolder |
The directory containing the source text files. | |
filePatterns |
The search pattern used to filter files (e.g. "*.txt"). | |
progressReport |
An optional callback action that reports progress by receiving the file name currently being processed. |
Returns
A Divooka.LLM.VectorEmbedding.VectorStore instance containing the names (without extension), vector embeddings, and full text content of each file.
Divooka.Services.AIServices.LLM.DeepSeek
Provides methods to obtain text completions using the DeepSeek API,
which is built on top of the OpenAI API.
Divooka.Services.AIServices.LLM.DeepSeek.DeepSeekModel.DeepSeekChat
DeepSeek V3 model
Divooka.Services.AIServices.LLM.DeepSeek.DeepSeekModel.DeepSeekReasoner
DeepSeek R1 model
Divooka.Services.AIServices.LLM.DeepSeek.ConfigureDeekSeek()
Configures the DeepSeek API by providing the necessary API key and model selection.
Parameters
| Name | Description | Default |
|---|---|---|
apiKey |
The API key used to authenticate with the DeepSeek API. | |
model |
The DeepSeek model to use for generating the completion. Defaults to DeepSeekModel.DeepSeekChat. | |
serviceAddress |
Address for the service, expecting a /chat/completions endpoint for Chat Completion. | |
replyTokenSizeLimit |
Limit of reply token size. |
Returns
An Divooka.Services.AIServices.Providers.OpenAIConfiguration object for making API calls.
Divooka.Services.AIServices.LLM.DeepSeek.AutoTranslate()
Translates the source text into the specified target language using AI.
Remarks
Currently not implementing segmentation and is substitutable with a macro.
However, if segmentation were to be added, implementing it in C# would be ideal.
Parameters
| Name | Description | Default |
|---|---|---|
text |
The source text to translate. | |
targetLanguage |
The target language for translation. | |
configuration |
Optional configuration settings for the OpenAI API. |
Returns
The translated text.
Divooka.Services.AIServices.LLM.DeepSeek.AutoSummarize()
Summarizes the given source text using AI.
Remarks
Currently not implementing segmentation and is substitutable with a macro.
However, if segmentation were to be added, implementing it in C# would be ideal.
Parameters
| Name | Description | Default |
|---|---|---|
text |
The source text to summarize. | |
configuration |
Optional configuration settings for the OpenAI API. |
Returns
The summarized version of the text.
Divooka.Services.AIServices.LLM.DeepSeek.Complete()
Sends a query to the DeepSeek API and returns the generated completion.
Remarks
DeepSeek uses the OpenAI API under the hood. The completion is obtained by calling OpenAIHelper.ChatGPTComplete.
Parameters
| Name | Description | Default |
|---|---|---|
query |
The text query to be completed. | |
configuration |
Optional configuration for the DeepSeek API. If not provided, a default configuration is used. |
Returns
A System.String containing the generated completion text. Returns an empty string if no result is provided.
Divooka.Services.AIServices.LLM.DeepSeek.Complete()
Sends a system prompt along with a query to the DeepSeek API and returns the generated completion.
Remarks
DeepSeek uses the OpenAI API under the hood. The completion is obtained by calling OpenAIHelper.ChatGPTComplete.
Parameters
| Name | Description | Default |
|---|---|---|
system |
The system prompt that guides the behavior of the completion process. | |
query |
The text query to be completed. | |
configuration |
Optional configuration for the DeepSeek API. If not provided, a default configuration is used. |
Returns
A System.String containing the generated completion text. Returns an empty string if no result is provided.
Divooka.Services.AIServices.LLM.DeepSeek.Chat()
Provides a continuous chat experience with automatic memory size management.
This method interacts with OpenAI's ChatGPT, maintaining a session history
and returning responses based on user input and system prompts.
Parameters
| Name | Description | Default |
|---|---|---|
sessionHistory |
An output parameter that returns the formatted session history as a Markdown string. | |
system |
The system prompt that sets the context for the chat. | |
input |
The user's input message for the chat session. | |
memorySize |
The number of past interactions to remember in the chat session (default is 3). | |
sessionName |
The name of the chat session, used for identifying stored histories (default is "Default.Session"). | |
configuration |
Optional configuration settings for the OpenAI API. |
Returns
The response from the AI model as a string, or an error message in case of failure.
Divooka.Services.AIServices.LLM.OllamaHelper
Provides non-streamed API to Ollama
Divooka.Services.AIServices.LLM.OllamaHelper.ConfigureOllama()
Parameters
| Name | Description | Default |
|---|---|---|
serviceToken |
Required for Methodox One services. |
Divooka.Services.AIServices.Providers.FunctionCallingHelper.GenerateFunctionDescription()
Automatically generates JSON schema based on function description.
Divooka.Services.AIServices.Providers.FunctionCallingHelper.AssembleFunctionCallTools()
Return a "[..Tools]" array
Parameters
| Name | Description | Default |
|---|---|---|
functions |
||
responseStyle |
If not it's "completion" style. |
Returns
Divooka.Services.AIServices.Providers.HuggingFaceServerless
Provides serverless methods powered by HuggingFace service API.
Remarks
Powered by HuggingFace service API
Divooka.Services.AIServices.Providers.HuggingFaceServerless.HuggingFaceConfiguration
Represents the configuration settings for HuggingFace API.
Divooka.Services.AIServices.Providers.HuggingFaceServerless.HuggingFaceConfiguration.APIKey
Gets or sets the API key for HuggingFace service.
Divooka.Services.AIServices.Providers.HuggingFaceServerless.TextGeneration()
Generates text based on the provided input using a specified HuggingFace model.
Parameters
| Name | Description | Default |
|---|---|---|
inputText |
The input text prompt. | |
model |
The model identifier (default is "openai-community/gpt2"). | |
configuration |
Optional configuration containing the API key. |
Returns
The generated text response.
Divooka.Services.AIServices.Providers.HuggingFaceServerless.TextToImage()
Generates an image from the provided text using a specified HuggingFace model.
Parameters
| Name | Description | Default |
|---|---|---|
inputText |
The text prompt for image generation. | |
model |
The model identifier (default is "black-forest-labs/FLUX.1-dev"). | |
width |
The desired image width (default is 512). | |
height |
The desired image height (default is 512). | |
configuration |
Optional configuration containing the API key. |
Returns
A PixelImage representing the generated image.
Divooka.Services.AIServices.Providers.HuggingFaceServerless.ImageTextToImage()
Generates a text description from an image URL and an input prompt using a specified HuggingFace model.
Parameters
| Name | Description | Default |
|---|---|---|
imageUrl |
The URL of the image. | |
prompt |
The text prompt (default is "Describe this image in one sentence."). | |
model |
The model identifier (default is "Qwen/QVQ-72B-preview"). | |
configuration |
Optional configuration containing the API key. |
Returns
The generated text description.
Divooka.Services.AIServices.Providers.NIMConfiguration
NIM API Service configuration
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMModel
Model types available through NIM API service
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMModel.#ctor()
Model types available through NIM API service
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMModelConfiguration.Model
Selected model configuration for the API.
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMModelConfiguration.MaxTokens
Maximum number of tokens the model can generate in a response.
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMModelConfiguration.Temperature
Controls the randomness of responses. Lower values make output more deterministic,
while higher values increase variability.
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMModelConfiguration.TopP
Nucleus sampling parameter. Controls diversity by considering only the top
`TopP` probability mass for sampling next token.
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMModelConfiguration.FrequencyPenalty
Penalizes frequent tokens, reducing their likelihood in the response.
Helps discourage repetitive phrases.
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMModelConfiguration.PresencePenalty
Penalizes new tokens based on whether they have already appeared in the text.
Encourages introducing new concepts.
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMModelConfiguration.Stream
Determines whether the API response is streamed in real time or returned as a
single completed response.
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMModelConfiguration.Seed
Random seed for reproducibility. A value of 0 means a random seed is used.
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMModelConfiguration.GetRequestBody
Constructs and returns the request body for an API call.
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMModelConfiguration.GetEndpointUrl()
Constructs and returns the url enpoint for an API call.
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMAllowedModels
Specifies the NVIDIA NIM models available for generating completions, images, or multi-modal content.
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMAllowedModels.LLaMA3_70B_Instruct
Meta LLaMA 3 model (70B)
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMAllowedModels.DeepSeekR1
DeepSeek Reasoner 1 (R1)
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMAllowedModels.Gemma2B
Google Gemma 2B model
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMAllowedModels.Phi3Medium128K
Microsoft Phi-3 Medium Instruct
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMAllowedModels.Mistral7BInstructV02
Mistral AI Mistral 7B Instruct
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMAllowedModels.SD3
Stable Diffusion 3 model (text-to-image)
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMAllowedModels.Bria23
Bria 2.3 model (text-to-image)
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMAllowedModels.Fuyu8B
Fuyu 8B (multi-modal)
Divooka.Services.AIServices.Providers.NIMConfiguration.NIMAllowedModels.Kosmos2
Kosmos 2 (multi-modal)
Divooka.Services.AIServices.Providers.NIMConfiguration.AllowedTextGenerationModelNameMapping
List of allowed models that can be used with the NIM API.
Divooka.Services.AIServices.Providers.NIMConfiguration.APIKey
API token for NIM API, fetched from environment variable if not explicitly provided.
Divooka.Services.AIServices.Providers.NIMConfiguration.AvailableModels
Available models through NIM API
Divooka.Services.AIServices.Providers.TextToImageConfiguration.AspectRatio
Aspect ratio of the generated image. Default is "1:1".
Divooka.Services.AIServices.Providers.TextToImageConfiguration.CfgScale
Scale for classifier-free guidance (CFG). Higher values make the model follow the prompt more strictly.
Default is 5.
Divooka.Services.AIServices.Providers.TextToImageConfiguration.Mode
Mode of operation. Default is "text-to-image".
Divooka.Services.AIServices.Providers.TextToImageConfiguration.NegativePrompt
Optional negative prompt to guide the model away from undesired content.
Divooka.Services.AIServices.Providers.TextToImageConfiguration.OutputFormat
Output format of the generated image. Default is "jpeg".
Divooka.Services.AIServices.Providers.TextToImageConfiguration.Steps
Number of steps for image generation. Higher values can improve quality but increase processing time.
Default is 50.
Divooka.Services.AIServices.Providers.NIM
Provides service to call NVIDIA NIM APIs.
Remarks
Powered by NVIDIA NIM service API.
Divooka.Services.AIServices.Providers.NIM.ConfigureNIM()
Configures the NVIDIA NIM API by providing the necessary API key and model selection.
Parameters
| Name | Description | Default |
|---|---|---|
apiKey |
The API key used to authenticate with the NIM API. | |
model |
Model selection with default parameters. |
Returns
An Divooka.Services.AIServices.Providers.NIMConfiguration object for making API calls.
Divooka.Services.AIServices.Providers.NIM.ConfigureNIM()
Configures the NVIDIA NIM API by providing the necessary API key and model selection.
Parameters
| Name | Description | Default |
|---|---|---|
apiKey |
The API key used to authenticate with the NIM API. | |
model |
The NIM model configuration used for inference. |
Returns
An Divooka.Services.AIServices.Providers.NIMConfiguration object for making API calls.
Divooka.Services.AIServices.Providers.NIM.ConfigureLlama3()
Configures the LLaMA3 model with customizable parameters.
Divooka.Services.AIServices.Providers.NIM.ConfigureDeepSeek()
Configures the DeepSeek R1 model with default parameters.
Returns
A configured instance of Divooka.Services.AIServices.Providers.DeepSeekConfiguration.
Divooka.Services.AIServices.Providers.NIM.ConfigureGemma2B()
Configures the Google Gemma 2B model with default parameters.
Returns
A configured instance of Divooka.Services.AIServices.Providers.Gemma2bConfiguration.
Divooka.Services.AIServices.Providers.NIM.ConfigurePhi3()
Configures the Phi3 model with customizable parameters.
Divooka.Services.AIServices.Providers.NIM.ConfigureMistral7B()
Configures the Mistral7B model with customizable parameters.
Divooka.Services.AIServices.Providers.NIM.ConfigureSD3()
Configures the SD3 (Stable Diffusion 3) model for text-to-image generation.
Divooka.Services.AIServices.Providers.NIM.ConfigureBriaAI()
Configures the Bria AI model for text-to-image generation.
Divooka.Services.AIServices.Providers.NIM.ConfigureKosmos2()
Configures the Kosmos 2 model with default parameters.
Returns
A configured instance of Divooka.Services.AIServices.Providers.Kosmos2Configuration.
Divooka.Services.AIServices.Providers.NIM.ConfigureFuyu8B()
Configures the Fuyu8B multi-modal model with customizable parameters.
Divooka.Services.AIServices.Providers.NIM.NimTextGeneration()
Calls the NVIDIA NIM API to generate text.
Parameters
| Name | Description | Default |
|---|---|---|
input |
User input prompt. | |
configuration |
Configuration with API key. |
Returns
Generated text from the model.
Divooka.Services.AIServices.Providers.NIM.NimTextToImage()
Calls the NVIDIA NIM API to generate an image from a text description.
Parameters
| Name | Description | Default |
|---|---|---|
input |
User input prompt. | |
configuration |
Configuration with API key. |
Returns
Generated text from the model.
Divooka.Services.AIServices.Providers.NIM.NimImageTextToText()
Calls the NVIDIA NIM API to generate a text response from an image/text input.
Parameters
| Name | Description | Default |
|---|---|---|
input |
User input prompt (e.g., description of the image). | |
configuration |
Configuration with API key. |
Returns
Generated response from the model.
Divooka.Services.AIServices.Providers.OpenAIConfiguration.OpenAIModelEnum
Used as GUI configuration options.
Divooka.Services.AIServices.Providers.OpenAIConfiguration.DefaultAssistantModel
Fallback assistant model id
Divooka.Services.AIServices.Providers.OpenAIHelper
Helper class for interacting with OpenAI services.
Divooka.Services.AIServices.Providers.OpenAIHelper.ConfigureOpenAI()
Configures the OpenAI API by providing the necessary API key and model selection.
Parameters
| Name | Description | Default |
|---|---|---|
apiKey |
The API key used to authenticate with the OpenAI API. | |
model |
The OpenAI model to use for generating the completion. Defaults to OpenAIo3Mini. | |
completionEndpoint |
Endpoint for Chat Completion. |
Returns
An Divooka.Services.AIServices.Providers.OpenAIConfiguration object for configuring API calls.
Divooka.Services.AIServices.Providers.OpenAIHelper.GetTokenCount()
Gets the token count for a given message and model.
Parameters
| Name | Description | Default |
|---|---|---|
message |
The message to analyze. | |
modelName |
The name of the OpenAI model. |
Returns
The number of tokens in the message.
Divooka.Services.AIServices.Providers.OpenAIHelper.ModerateFlag()
Use OpeNAI moderation to decide whether some content contains flagged information.
Parameters
| Name | Description | Default |
|---|---|---|
content |
The content to check. | |
configuration |
The OpenAI configuration settings. |
Returns
True if the content is flagged, otherwise false.
Divooka.Services.AIServices.Providers.OpenAIHelper.ChatGPTComplete()
Generates a completion using ChatGPT.
Parameters
| Name | Description | Default |
|---|---|---|
query |
The user query to be processed. | |
configuration |
The OpenAI configuration settings, including model, API token, and token size limit.. |
Returns
The generated response from ChatGPT.
Divooka.Services.AIServices.Providers.OpenAIHelper.ChatGPTComplete()
Generates a completion using ChatGPT.
Parameters
| Name | Description | Default |
|---|---|---|
query |
The user query to be processed. | |
configuration |
The OpenAI configuration settings, including model, API token, and token size limit.. |
Returns
The generated response from ChatGPT.
Divooka.Services.AIServices.Providers.OpenAIHelper.ChatGPTComplete()
Generates a completion using ChatGPT with a system message.
Parameters
| Name | Description | Default |
|---|---|---|
system |
The system message. | |
query |
The user query. | |
configuration |
The OpenAI configuration settings. |
Returns
The generated response from ChatGPT.
Divooka.Services.AIServices.Providers.OpenAIHelper.ChatGPTComplete()
Generates a completion using ChatGPT with a system message.
Parameters
| Name | Description | Default |
|---|---|---|
system |
The system message. | |
query |
The user query. | |
configuration |
The OpenAI configuration settings. | |
replyTokenSizeLimit |
Limit of reply's token size (length). |
Returns
The generated response from ChatGPT.
Divooka.Services.AIServices.Providers.OpenAIHelper.ChatGPTComplete()
Generates a completion using ChatGPT with a system message and a list of messages.
Parameters
| Name | Description | Default |
|---|---|---|
system |
The system message. | |
messages |
The list of messages exchanged in the conversation. | |
configuration |
The OpenAI configuration settings. |
Returns
The generated response from ChatGPT.
Divooka.Services.AIServices.Providers.OpenAIHelper.ChatGPTComplete()
Generates a completion using ChatGPT with additional tool options.
Parameters
| Name | Description | Default |
|---|---|---|
system |
The system message. | |
messages |
The list of messages exchanged in the conversation. | |
tools |
The tools used for additional processing. | |
configuration |
The OpenAI configuration settings. |
Returns
The generated response from ChatGPT.
Divooka.Services.AIServices.Providers.OpenAIHelper.ChatGPTComplete()
Complete using automatic configurations for specific model.
Parameters
| Name | Description | Default |
|---|---|---|
system |
The system message. | |
userQuery |
The user query. | |
model |
The OpenAI model configuration. | |
messageTokenCount |
The number of tokens used in the message. | |
abortIfExceedAllowance |
If true, aborts if the token count exceeds the allowed limit. |
Returns
The generated response from ChatGPT.
Divooka.Services.AIServices.Providers.OpenAIHelper.AskChatGPTAboutData()
Asks ChatGPT a question about structured data provided in CSV format.
Parameters
| Name | Description | Default |
|---|---|---|
question |
The question to ask. | |
dataCSV |
The structured data in CSV format. | |
apiToken |
The API token for authentication. |
Returns
The ChatGPT response as a string.
Divooka.Services.AIServices.Providers.OpenAIHelper.AskChatGPTAboutImage()
Asks ChatGPT a question about an image reference.
Parameters
| Name | Description | Default |
|---|---|---|
question |
The question to ask. | |
imageReference |
The reference to an image (e.g., URL or file path). | |
apiToken |
The API token for authentication. |
Returns
The ChatGPT response as a string.
Divooka.Services.AIServices.Providers.OpenAIHelper.GetEmbedding()
Retrieves an embedding representation of the given content.
Parameters
| Name | Description | Default |
|---|---|---|
content |
The input content. | |
configuration |
The OpenAI configuration settings. |
Returns
An array representing the embedding of the content.
Divooka.Services.AIServices.Providers.OpenAIHelper.UseComputerScreenshot()
Only used for reply. Must use UseComputer to start usage first.
Divooka.Services.AIServices.Providers.OpenAIHelper.TranscribeFolderAudios()
Transcribe with automatic chunking.
Divooka.Services.AIServices.Providers.OpenAIHelper.Transcribe()
Transcribes a 44.1 kHz stereo clip via Whisper.
Divooka.Services.AIServices.Providers.OpenAIHelper.Transcribe()
Splits a long clip into ≤ maxChunkSize s pieces before sending to Whisper.
Parameters
| Name | Description | Default |
|---|---|---|
maxChunkSize |
The OpenAI API can handle at most this large chunk at a time - we will internally slice the segment to fit within the chunks and aggregate final transcription. |
Divooka.Services.AIServices.Providers.OpenAIHelper.Transcribe()
Batch‑transcribes multiple clips, chunking each one when necessary.
Divooka.Services.AIServices.Providers.OpenAIHelper.TextToSpeech()
Synthesises speech and returns it as a 44.1 kHz stereo segment.
Divooka.Services.AIServices.Providers.OpenAIHelper.TextToSpeechRaw()
Simple text-to-speech. No tone reflection etc. For advanced use, do GenerateAudio.
Parameters
| Name | Description | Default |
|---|---|---|
text |
||
configuration |
Returns
Divooka.Services.AIServices.Providers.OpenAIHelper.GenerateAudioCompletion()
Like text completion, but also generates an audio version.
Divooka.Services.AIServices.Providers.OpenAIHelper.BreakdownMessageBruteForce()
Breaks down a message into smaller parts based on token size constraints.
Given an original message and allowable max window size, break it down by token count.
Parameters
| Name | Description | Default |
|---|---|---|
piece |
The message piece to break down. | |
model |
The OpenAI model. | |
availableContextTokenSize |
The maximum number of tokens available per segment. |
Returns
A sequence of message parts that fit within the token limit.
Divooka.Services.AIServices.Providers.OpenAIHelper.NamedThreads
Small persistent mapping so users can refer to a conversation by a human readable name like "My brilliant brainstorm" instead of a UUID‑v4 thread id.
Divooka.Services.AIServices.Providers.OpenAIHelper.CreateThreadAsync()
Creates a new thread and stores an optional friendly name mapping.
Divooka.Services.AIServices.Providers.OpenAIHelper.EnsureThreadAsync()
Resolves a thread identifier or creates one if it does not exist yet.
Divooka.Services.AIServices.Providers.OpenAIHelper.ChatGPTComplete()
Generates a completion response from ChatGPT using the specified system prompt, query, model, API token, and token size limit.
Parameters
| Name | Description | Default |
|---|---|---|
system |
The system-level instruction for the model. | |
query |
The user query to be processed. | |
model |
The ChatGPT model to use for the response. | |
apiToken |
The API token for authentication. | |
sizeLimit |
The maximum number of tokens allowed in the response. |
Returns
The ChatGPT response as a string.