Class ApiHelper
- Namespace
- Oobabooga
APIHelper
- Assembly
- DougWare.OobaboogaAPIHelper.dll
A helper class for interacting with the OobaboogaAPI extension.
- Inheritance
-
Api
Helper
- Inherited Members
Methods
GenerateAsync(GenerateRequestBody, PromptTemplate)
Sends a request to the API to generate a response based on a given request body and prompt template.
public static Task<string> GenerateAsync(ApiHelper.GenerateRequestBody requestBody, PromptTemplate promptTemplate)
Parameters
requestBody
ApiHelper .GenerateRequest Body The request body to use for the generation request.
promptTemplate
PromptTemplate The prompt template to use for the generation request.
Returns
- Task<string>
A Task that represents the asynchronous operation. The task result is a string containing the generated text.
Exceptions
- Http
Request Exception Thrown if the API request does not return a success status code.
GetTokenCountAsync(string)
Sends a request to the API to get the token count of a given prompt.
Parameters
prompt
stringThe prompt to get the token count for.
Returns
- Task<int>
A Task that represents the asynchronous operation. The task result is an integer representing the token count.
Exceptions
- Http
Request Exception Thrown if the API request does not return a success status code.