SfapApiClient

class SfapApiClient(apiHostName: String, modelName: String? = null, restClient: RestClient)

Provides REST client methods for a variety of sfap_api endpoints.

  • chat-generations

  • embeddings

  • feedback

  • generations

See https://developer.salesforce.com/docs/einstein/genai/guide/access-models-api-with-rest.html

Parameters

apiHostName

The Salesforce sfap_api hostname

modelName

The model name to request from. For possible values, see https://developer.salesforce.com/docs/einstein/genai/guide/api-names.html. Note that the embeddings endpoint requires an embeddings-enabled model such as sfdc_ai__DefaultOpenAITextEmbeddingAda_002. Also note that submitting to the feedback endpoint does not require value for this parameter

restClient

The REST client to use

Constructors

Link copied to clipboard
constructor(apiHostName: String, modelName: String? = null, restClient: RestClient)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Fetches generated chat responses from the sfap_api chat-generations endpoint.

Link copied to clipboard

Submit a request to the sfap_api embeddings endpoint.

Link copied to clipboard

Fetches generated text from the sfap_api "generations" endpoint.

Link copied to clipboard

Submits feedback for previously generated text from the sfap_api endpoints to the sfap_api feedback endpoint.