LLM for Unity
v2.4.0
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 |
toggle to show/hide advanced options in the GameObject | |
bool | remote = false |
toggle to use remote LLM server or local LLM | |
string | APIKey |
allows to use a server with API key | |
string | host = "localhost" |
host to use for the LLM server | |
int | port = 13333 |
port to use for the LLM server | |
int | numRetries = 10 |
number of retries to use for the 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 53 of file LLMCaller.cs.
|
inlinevirtual |
Cancel the ongoing requests e.g. Chat, Complete.
Definition at line 221 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 352 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 367 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 105 of file LLMCaller.cs.
|
inlinevirtual |
Checks if a LLM is valid for the LLMCaller.
llmSet | LLM object |
Reimplemented in LLMUnity.LLMCharacter.
Definition at line 95 of file LLMCaller.cs.
|
inlinevirtual |
Tokenises the provided query.
query | query to tokenise |
callback | callback function called with the result tokens |
Definition at line 337 of file LLMCaller.cs.
bool LLMUnity.LLMCaller.advancedOptions = false |
toggle to show/hide advanced options in the GameObject
Definition at line 19 of file LLMCaller.cs.
string LLMUnity.LLMCaller.APIKey |
allows to use a server with API key
Definition at line 31 of file LLMCaller.cs.
string LLMUnity.LLMCaller.host = "localhost" |
host to use for the LLM server
Definition at line 34 of file LLMCaller.cs.
int LLMUnity.LLMCaller.numRetries = 10 |
number of retries to use for the LLM server requests (-1 = infinite)
Definition at line 38 of file LLMCaller.cs.
int LLMUnity.LLMCaller.port = 13333 |
port to use for the LLM server
Definition at line 36 of file LLMCaller.cs.
bool LLMUnity.LLMCaller.remote = false |
toggle to use remote LLM server or local LLM
Definition at line 21 of file LLMCaller.cs.
|
getset |
Definition at line 24 of file LLMCaller.cs.