genstudio-uix-sdk

@adobe/genstudio-uix-sdk


@adobe/genstudio-uix-sdk / GenerationContextService

Class: GenerationContextService

Constructors

new GenerationContextService()

new GenerationContextService(): GenerationContextService

Returns

GenerationContextService

Methods

getGenerationContext()

static getGenerationContext(connection: GuestUI<CreateApi>): Promise<GenerationContext>

Gets the generation context

Parameters

connection

GuestUI<CreateApi>

The guest connection to the host

Returns

Promise<GenerationContext>

The generation context

Throws

Error if connection is missing


setAdditionalContext()

static setAdditionalContext(connection: GuestUI<CreateApi>, additionalContext: AdditionalContext<any>): Promise<void>

Sets additional context on the prompt

Parameters

connection

GuestUI<CreateApi>

The guest connection to the host

additionalContext

AdditionalContext<any>

The additional context object

Returns

Promise<void>

void

Throws

Error if connection is missing