LLM for Unity  v3.0.1
Create characters in Unity with LLMs!
Loading...
Searching...
No Matches
LLMEmbedder.cs
Go to the documentation of this file.
1
3using System.Threading.Tasks;
4using UnityEngine;
5
6namespace LLMUnity
7{
8 [DefaultExecutionOrder(-2)]
13 public class LLMEmbedder : LLMClient
14 {
15 protected override async Task SetLLM(LLM llmSet)
16 {
17 await base.SetLLM(llmSet);
18 if (llmSet != null && !llmSet.embeddingsOnly)
19 {
20 LLMUnitySetup.LogWarning($"The LLM {llmSet.name} set for LLMEmbeddings {gameObject.name} is not an embeddings-only model, accuracy may be sub-optimal");
21 }
22 }
23
24 public override bool IsAutoAssignableLLM(LLM llmSet)
25 {
26 return llmSet.embeddingsOnly;
27 }
28 }
29}
Unity MonoBehaviour base class for LLM client functionality. Handles both local and remote LLM connec...
Definition LLMClient.cs:21
Class implementing the LLM embedder.
override bool IsAutoAssignableLLM(LLM llmSet)
Determines if an LLM instance can be auto-assigned to this client. Override in derived classes to imp...
Class implementing helper functions for setup and process management.
Unity MonoBehaviour component that manages a local LLM server instance. Handles model loading,...
Definition LLM.cs:21
bool embeddingsOnly
True if this model only supports embeddings (no text generation)
Definition LLM.cs:306