/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: a73bb90ada41 */ import { betaObservabilityChatCompletionEventsFetch } from "../funcs/betaObservabilityChatCompletionEventsFetch.js"; import { betaObservabilityChatCompletionEventsFetchSimilarEvents } from "../funcs/betaObservabilityChatCompletionEventsFetchSimilarEvents.js"; import { betaObservabilityChatCompletionEventsJudge } from "../funcs/betaObservabilityChatCompletionEventsJudge.js"; import { betaObservabilityChatCompletionEventsSearch } from "../funcs/betaObservabilityChatCompletionEventsSearch.js"; import { betaObservabilityChatCompletionEventsSearchIds } from "../funcs/betaObservabilityChatCompletionEventsSearchIds.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; import { Fields } from "./fields.js"; export class ChatCompletionEvents extends ClientSDK { private _fields?: Fields; get fields(): Fields { return (this._fields ??= new Fields(this._options)); } /** * Get Chat Completion Events */ async search( request: operations.GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest, options?: RequestOptions, ): Promise { return unwrapAsync(betaObservabilityChatCompletionEventsSearch( this, request, options, )); } /** * Alternative to /search that returns only the IDs and that can return many IDs at once */ async searchIds( request: components.SearchChatCompletionEventIdsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(betaObservabilityChatCompletionEventsSearchIds( this, request, options, )); } /** * Get Chat Completion Event */ async fetch( request: operations.GetChatCompletionEventV1ObservabilityChatCompletionEventsEventIdGetRequest, options?: RequestOptions, ): Promise { return unwrapAsync(betaObservabilityChatCompletionEventsFetch( this, request, options, )); } /** * Get Similar Chat Completion Events */ async fetchSimilarEvents( request: operations.GetSimilarChatCompletionEventsV1ObservabilityChatCompletionEventsEventIdSimilarEventsGetRequest, options?: RequestOptions, ): Promise { return unwrapAsync(betaObservabilityChatCompletionEventsFetchSimilarEvents( this, request, options, )); } /** * Run Judge on an event based on the given options */ async judge( request: operations.JudgeChatCompletionEventV1ObservabilityChatCompletionEventsEventIdLiveJudgingPostRequest, options?: RequestOptions, ): Promise { return unwrapAsync(betaObservabilityChatCompletionEventsJudge( this, request, options, )); } }