DXP AI SERVICE CLIENT LIB
How to use
- Here is an example Ai service from the dxp console
export class AiService extends BaseService {
public readonly apiClient: DxpAiService<unknown>;
public constructor(configuration: AiServiceConfiguration) {
super(configuration);
const baseUrl = this.getServiceUrlByTenant('ai');
if (!baseUrl) {
throw new Error('BaseUrl is undefined');
}
const httpClient = createClient({
baseUrl: baseUrl,
});
this.apiClient = new DxpAiService(httpClient);
}
}
Now the routes of the service can be called as functions like so:
const result = apiClient.generative.create()