ChatWorkspaces
extends Endpoint
in package
uses
HandlesChatWorkspaceSettings
Table of Contents
Constants
- PATH = '/chats'
Properties
- $apiKey : string|null
- $http : Http
- $workspaceName : non-empty-string|null
Methods
- __construct() : mixed
- getSettings() : ChatWorkspaceSettings
- Get the current settings for this chat workspace.
- listWorkspaces() : ChatWorkspacesResults
- resetSettings() : ChatWorkspaceSettings
- Reset the settings for this chat workspace to default values.
- show() : array<string|int, mixed>|null
- streamCompletion() : StreamInterface
- Create a streaming chat completion using OpenAI-compatible API.
- updateSettings() : ChatWorkspaceSettings
- Update the settings for this chat workspace.
- workspace() : self
Constants
PATH
protected
mixed
PATH
= '/chats'
Properties
$apiKey
protected
string|null
$apiKey
$http
protected
Http
$http
$workspaceName
private
non-empty-string|null
$workspaceName
Methods
__construct()
public
__construct(Http $http[, string|null $workspaceName = null ]) : mixed
Parameters
- $http : Http
- $workspaceName : string|null = null
getSettings()
Get the current settings for this chat workspace.
public
getSettings() : ChatWorkspaceSettings
Return values
ChatWorkspaceSettingslistWorkspaces()
public
listWorkspaces() : ChatWorkspacesResults
Return values
ChatWorkspacesResultsresetSettings()
Reset the settings for this chat workspace to default values.
public
resetSettings() : ChatWorkspaceSettings
Return values
ChatWorkspaceSettingsshow()
public
show() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullstreamCompletion()
Create a streaming chat completion using OpenAI-compatible API.
public
streamCompletion(array{model: string, messages: array{role: string, content: string}[], stream: bool} $options) : StreamInterface
Parameters
- $options : array{model: string, messages: array{role: string, content: string}[], stream: bool}
-
The request body for the chat completion
Return values
StreamInterfaceupdateSettings()
Update the settings for this chat workspace.
public
updateSettings(array{source?: "openAi"|"azureOpenAi"|"mistral"|"gemini"|"vLlm", orgId?: string, projectId?: string, apiVersion?: string, deploymentId?: string, baseUrl?: string, apiKey?: string, prompts?: array} $settings) : ChatWorkspaceSettings
Parameters
-
$settings
: array{source?: "openAi"|"azureOpenAi"|"mistral"|"gemini"|"vLlm", orgId?: string, projectId?: string, apiVersion?: string, deploymentId?: string, baseUrl?: string, apiKey?: string, prompts?: array
}
Return values
ChatWorkspaceSettingsworkspace()
public
workspace(string $workspaceName) : self
Parameters
- $workspaceName : string