![]() |
LLM for Unity
v2.4.2
Create characters in Unity with LLMs!
|
Class implementing calling of LLM functions (local and remote). More...
Public Member Functions | |
virtual void | Awake () |
The Unity Awake function that initializes the state before the application starts. The following actions are executed: | |
virtual bool | IsValidLLM (LLM llmSet) |
Checks if a LLM is valid for the LLMCaller. | |
virtual bool | IsAutoAssignableLLM (LLM llmSet) |
Checks if a LLM can be auto-assigned if the LLM of the LLMCaller is null. | |
virtual void | CancelRequests () |
Cancel the ongoing requests e.g. Chat, Complete. | |
virtual async Task< List< int > > | Tokenize (string query, Callback< List< int > > callback=null) |
Tokenises the provided query. | |
virtual async Task< string > | Detokenize (List< int > tokens, Callback< string > callback=null) |
Detokenises the provided tokens to a string. | |
virtual async Task< List< float > > | Embeddings (string query, Callback< List< float > > callback=null) |
Computes the embeddings of the provided input. | |
Public Attributes | |
bool | advancedOptions = false |
show/hide advanced options in the GameObject | |
bool | remote = false |
use remote LLM server | |
string | APIKey |
API key for the remote server. | |
string | host = "localhost" |
host of the remote LLM server | |
int | port = 13333 |
port of the remote LLM server | |
int | numRetries = 10 |
number of retries to use for the remote LLM server requests (-1 = infinite) | |
Properties | |
LLM | llm [get, set] |
Class implementing calling of LLM functions (local and remote).
Definition at line 16 of file LLMCaller.cs.
|
inlinevirtual |
The Unity Awake function that initializes the state before the application starts. The following actions are executed:
Reimplemented in LLMUnity.LLMCharacter.
Definition at line 58 of file LLMCaller.cs.
|
inlinevirtual |
Cancel the ongoing requests e.g. Chat, Complete.
Definition at line 230 of file LLMCaller.cs.
|
inlinevirtual |
Detokenises the provided tokens to a string.
tokens | tokens to detokenise |
callback | callback function called with the result string |
Definition at line 363 of file LLMCaller.cs.
|
inlinevirtual |
Computes the embeddings of the provided input.
tokens | input to compute the embeddings for |
callback | callback function called with the result string |
Definition at line 378 of file LLMCaller.cs.
|
inlinevirtual |
Checks if a LLM can be auto-assigned if the LLM of the LLMCaller is null.
<param name="llmSet"LLM object>
Reimplemented in LLMUnity.LLMEmbedder.
Definition at line 110 of file LLMCaller.cs.
|
inlinevirtual |
Checks if a LLM is valid for the LLMCaller.
llmSet | LLM object |
Reimplemented in LLMUnity.LLMCharacter.
Definition at line 100 of file LLMCaller.cs.
|
inlinevirtual |
Tokenises the provided query.
query | query to tokenise |
callback | callback function called with the result tokens |
Definition at line 348 of file LLMCaller.cs.
bool LLMUnity.LLMCaller.advancedOptions = false |
show/hide advanced options in the GameObject
Definition at line 20 of file LLMCaller.cs.
string LLMUnity.LLMCaller.APIKey |
API key for the remote server.
Definition at line 34 of file LLMCaller.cs.
string LLMUnity.LLMCaller.host = "localhost" |
host of the remote LLM server
Definition at line 37 of file LLMCaller.cs.
int LLMUnity.LLMCaller.numRetries = 10 |
number of retries to use for the remote LLM server requests (-1 = infinite)
Definition at line 43 of file LLMCaller.cs.
int LLMUnity.LLMCaller.port = 13333 |
port of the remote LLM server
Definition at line 40 of file LLMCaller.cs.
bool LLMUnity.LLMCaller.remote = false |
use remote LLM server
Definition at line 23 of file LLMCaller.cs.
|
getset |
Definition at line 27 of file LLMCaller.cs.