LLMClient Class
Singleton client for the DWSIM Assistant HTTP/WebSocket API.
All members are implicitly Shared (VB.NET Module).
Definition
Namespace: DWSIM.SharedClasses
Assembly: DWSIM.SharedClasses (in DWSIM.SharedClasses.dll) Version: 10.0.0.0
Assembly: DWSIM.SharedClasses (in DWSIM.SharedClasses.dll) Version: 10.0.0.0
C#
public class LLMClientVB
Public Class LLMClient- Inheritance
- Object LLMClient
Constructors
Methods
| ApplyConfigAsync | Push all API key and integration settings to the running server (POST /api-keys) then switch the backend (PATCH /session). |
| Ask | Synchronous LLM call. Blocks the calling thread until the full response arrives. Safe to use from IronPython scripts and non-UI contexts. Prefer AskAsync in async/UI code. |
| AskAsync | Asynchronous streaming LLM call via WebSocket. Calls onChunk for each received text fragment. Returns the complete concatenated response when the stream ends. Uses the server's currently active backend and model by default. |
| Debug | |
| EffectiveModel | Returns the model name that matches the server's current active backend. Falls back to locally configured values. |
| Esc | Escape a string for embedding inside a JSON string value. |
| FetchSettingsFromServerAsync | Reads the server's active settings (GET /api-keys + GET /session) and updates Config with non-secret fields: models, endpoints, backend, flags. API keys in Config are NOT overwritten (server returns masked values). Call this whenever the user may have changed settings via the web UI. |
| InitAsync | |
| IsServerRunningAsync | Returns True if the server responds on /session within 3 seconds. |
| JBool | Extract a boolean value from a flat JSON object. Returns True when the value is the JSON literal true. |
| JInt | JSON integer field: "key":number |
| JS | JSON string field: "key":"escaped_value" |
| JsonUnescape | |
| JStr | Extract a string value from a flat JSON object. Handles "key":"value" and "key": "value" (with whitespace). Returns "" when the key is absent or the value is null/empty. |
| OpenInBrowser | Open the DWSIM Assistant web UI in the default browser. |
| OverwriteIfNotEmpty | Only update a config property if the new value is non-empty. |
| SetBackendAsync | Switch the active LLM backend: local | openai | claude | custom | azure. |
Fields
Extension Methods
| GetEnumNames | (Defined by General) |
| IsValidDouble | (Defined by General) |