- list - Get Chat Completion Fields
- fetchOptions - Get Chat Completion Field Options
- fetchOptionCounts - Get Chat Completion Field Options Counts
Get Chat Completion Fields
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.observability.chatCompletionEvents.fields.list();
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityChatCompletionEventsFieldsList } from "@mistralai/mistralai/funcs/betaObservabilityChatCompletionEventsFieldsList.js";
// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const res = await betaObservabilityChatCompletionEventsFieldsList(mistral);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityChatCompletionEventsFieldsList failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.ListChatCompletionFieldsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get Chat Completion Field Options
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.observability.chatCompletionEvents.fields.fetchOptions({
fieldName: "<value>",
operator: "startswith",
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityChatCompletionEventsFieldsFetchOptions } from "@mistralai/mistralai/funcs/betaObservabilityChatCompletionEventsFieldsFetchOptions.js";
// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const res = await betaObservabilityChatCompletionEventsFieldsFetchOptions(mistral, {
fieldName: "<value>",
operator: "startswith",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityChatCompletionEventsFieldsFetchOptions failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.FetchChatCompletionFieldOptionsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get Chat Completion Field Options Counts
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.observability.chatCompletionEvents.fields.fetchOptionCounts({
fieldName: "<value>",
fetchFieldOptionCountsRequest: {},
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityChatCompletionEventsFieldsFetchOptionCounts } from "@mistralai/mistralai/funcs/betaObservabilityChatCompletionEventsFieldsFetchOptionCounts.js";
// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const res = await betaObservabilityChatCompletionEventsFieldsFetchOptionCounts(mistral, {
fieldName: "<value>",
fetchFieldOptionCountsRequest: {},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityChatCompletionEventsFieldsFetchOptionCounts failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.FetchFieldOptionCountsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |