Skip to main content
Call path: client.scopes after new Modus(...).

Methods

chat()

Send a message to a scope and get the complete reply.

Parameters

string | number
required
Scope numeric id or slug.
string
required
Message to send.
required

Returns

Promise<ChatResult> Chat result with content and threadId.

chatStream()

Stream a scope reply token by token.

Parameters

string | number
required
Scope numeric id or slug.
string
required
Message to send.
required

Returns

ChatStream Chat stream.

conversations()

Return the conversations sub-resource scoped to scopeId.

Parameters

string | number
required
Scope numeric id or slug.

Returns

ScopeConversationsResource Conversations resource for the scope.

get()

Retrieve a scope by ID or slug.

Parameters

string | number
required
Scope numeric id or slug.
{ view: VariationView }

Returns

Promise<object> Scope.

getContext()

Return composed context Modus would use for a scope query, without running chat.

Parameters

string | number
required
Scope numeric id or slug.
string
required
User intent or question to compose context for.
{ limit: number }

Returns

Promise<object> Composed scope context.

list()

List scopes in the organisation.

Parameters

Returns

Promise<Page<object>> Page of scopes.