vellum-ai 0.0.45 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +23 -26
- package/Client.js +288 -242
- package/api/resources/deployments/client/Client.d.ts +8 -4
- package/api/resources/deployments/client/Client.js +52 -34
- package/api/resources/documentIndexes/client/Client.d.ts +9 -5
- package/api/resources/documentIndexes/client/Client.js +97 -69
- package/api/resources/documents/client/Client.d.ts +14 -10
- package/api/resources/documents/client/Client.js +222 -176
- package/api/resources/index.d.ts +0 -1
- package/api/resources/index.js +0 -1
- package/api/resources/modelVersions/client/Client.d.ts +8 -8
- package/api/resources/modelVersions/client/Client.js +51 -75
- package/api/resources/modelVersions/client/index.d.ts +1 -1
- package/api/resources/modelVersions/client/index.js +0 -15
- package/api/resources/registeredPrompts/client/Client.d.ts +11 -7
- package/api/resources/registeredPrompts/client/Client.js +72 -53
- package/api/resources/registeredPrompts/client/requests/RegisterPromptRequestRequest.d.ts +4 -1
- package/api/resources/sandboxes/client/Client.d.ts +9 -5
- package/api/resources/sandboxes/client/Client.js +92 -65
- package/api/resources/testSuites/client/Client.d.ts +9 -5
- package/api/resources/testSuites/client/Client.js +90 -63
- package/api/types/EnrichedNormalizedCompletion.d.ts +3 -1
- package/api/types/ModelVersionRead.d.ts +3 -0
- package/api/types/ProviderEnum.d.ts +7 -1
- package/api/types/ProviderEnum.js +3 -0
- package/api/types/RegisterPromptPromptInfoRequest.d.ts +0 -1
- package/api/types/RegisterPromptResponse.d.ts +2 -0
- package/api/types/index.d.ts +0 -2
- package/api/types/index.js +0 -2
- package/core/fetcher/Fetcher.d.ts +5 -3
- package/core/fetcher/Fetcher.js +104 -62
- package/core/fetcher/Supplier.js +11 -2
- package/core/fetcher/index.d.ts +3 -2
- package/core/form-data-utils/getFormDataContentLength.d.ts +1 -1
- package/core/form-data-utils/getFormDataContentLength.js +20 -9
- package/core/index.d.ts +1 -2
- package/core/index.js +4 -5
- package/core/schemas/Schema.d.ts +19 -0
- package/core/schemas/Schema.js +1 -0
- package/core/schemas/builders/date/date.js +22 -14
- package/core/schemas/builders/enum/enum.js +17 -7
- package/core/schemas/builders/lazy/index.d.ts +2 -1
- package/core/schemas/builders/lazy/lazy.js +21 -13
- package/core/schemas/builders/lazy/lazyObject.js +11 -11
- package/core/schemas/builders/list/list.js +53 -38
- package/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
- package/core/schemas/builders/literals/booleanLiteral.js +29 -0
- package/core/schemas/builders/literals/index.d.ts +1 -0
- package/core/schemas/builders/literals/index.js +3 -1
- package/core/schemas/builders/literals/stringLiteral.js +4 -3
- package/core/schemas/builders/object/index.d.ts +5 -2
- package/core/schemas/builders/object/index.js +3 -1
- package/core/schemas/builders/object/object.js +150 -129
- package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
- package/core/schemas/builders/object/objectWithoutOptionalProperties.js +8 -0
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +19 -18
- package/core/schemas/builders/object-like/index.d.ts +1 -1
- package/core/schemas/builders/primitives/boolean.js +4 -3
- package/core/schemas/builders/primitives/number.js +4 -3
- package/core/schemas/builders/primitives/string.js +4 -3
- package/core/schemas/builders/record/index.d.ts +1 -1
- package/core/schemas/builders/record/record.js +82 -67
- package/core/schemas/builders/schema-utils/JsonError.js +0 -1
- package/core/schemas/builders/schema-utils/ParseError.js +0 -1
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +23 -20
- package/core/schemas/builders/schema-utils/index.d.ts +2 -1
- package/core/schemas/builders/set/set.js +21 -12
- package/core/schemas/builders/undiscriminated-union/index.d.ts +1 -1
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +38 -24
- package/core/schemas/builders/union/index.d.ts +3 -2
- package/core/schemas/builders/union/union.js +95 -74
- package/core/schemas/index.d.ts +1 -1
- package/core/schemas/utils/createIdentitySchemaCreator.js +2 -4
- package/core/schemas/utils/getErrorMessageForIncorrectType.d.ts +1 -0
- package/core/schemas/utils/getErrorMessageForIncorrectType.js +24 -0
- package/core/schemas/utils/isPlainObject.d.ts +0 -1
- package/core/schemas/utils/isPlainObject.js +1 -2
- package/core/schemas/utils/maybeSkipValidation.d.ts +2 -0
- package/core/schemas/utils/maybeSkipValidation.js +37 -0
- package/core/streaming-fetcher/Stream.d.ts +14 -0
- package/core/streaming-fetcher/Stream.js +75 -0
- package/core/streaming-fetcher/StreamingFetcher.d.ts +10 -8
- package/core/streaming-fetcher/StreamingFetcher.js +38 -44
- package/core/streaming-fetcher/getHeader.d.ts +2 -0
- package/core/streaming-fetcher/getHeader.js +12 -0
- package/core/streaming-fetcher/index.d.ts +4 -1
- package/core/streaming-fetcher/index.js +5 -1
- package/dist/Client.d.ts +23 -26
- package/dist/Client.js +288 -242
- package/dist/api/resources/deployments/client/Client.d.ts +8 -4
- package/dist/api/resources/deployments/client/Client.js +52 -34
- package/dist/api/resources/documentIndexes/client/Client.d.ts +9 -5
- package/dist/api/resources/documentIndexes/client/Client.js +97 -69
- package/dist/api/resources/documents/client/Client.d.ts +14 -10
- package/dist/api/resources/documents/client/Client.js +222 -176
- package/dist/api/resources/index.d.ts +0 -1
- package/dist/api/resources/index.js +0 -1
- package/dist/api/resources/modelVersions/client/Client.d.ts +8 -8
- package/dist/api/resources/modelVersions/client/Client.js +51 -75
- package/dist/api/resources/modelVersions/client/index.d.ts +1 -1
- package/dist/api/resources/modelVersions/client/index.js +0 -15
- package/dist/api/resources/registeredPrompts/client/Client.d.ts +11 -7
- package/dist/api/resources/registeredPrompts/client/Client.js +72 -53
- package/dist/api/resources/registeredPrompts/client/requests/RegisterPromptRequestRequest.d.ts +4 -1
- package/dist/api/resources/sandboxes/client/Client.d.ts +9 -5
- package/dist/api/resources/sandboxes/client/Client.js +92 -65
- package/dist/api/resources/testSuites/client/Client.d.ts +9 -5
- package/dist/api/resources/testSuites/client/Client.js +90 -63
- package/dist/api/types/EnrichedNormalizedCompletion.d.ts +3 -1
- package/dist/api/types/ModelVersionRead.d.ts +3 -0
- package/dist/api/types/ProviderEnum.d.ts +7 -1
- package/dist/api/types/ProviderEnum.js +3 -0
- package/dist/api/types/RegisterPromptPromptInfoRequest.d.ts +0 -1
- package/dist/api/types/RegisterPromptResponse.d.ts +2 -0
- package/dist/api/types/index.d.ts +0 -2
- package/dist/api/types/index.js +0 -2
- package/dist/core/fetcher/Fetcher.d.ts +5 -3
- package/dist/core/fetcher/Fetcher.js +104 -62
- package/dist/core/fetcher/Supplier.js +11 -2
- package/dist/core/fetcher/index.d.ts +3 -2
- package/dist/core/form-data-utils/getFormDataContentLength.d.ts +1 -1
- package/dist/core/form-data-utils/getFormDataContentLength.js +20 -9
- package/dist/core/index.d.ts +1 -2
- package/dist/core/index.js +4 -5
- package/dist/core/schemas/Schema.d.ts +19 -0
- package/dist/core/schemas/Schema.js +1 -0
- package/dist/core/schemas/builders/date/date.js +22 -14
- package/dist/core/schemas/builders/enum/enum.js +17 -7
- package/dist/core/schemas/builders/lazy/index.d.ts +2 -1
- package/dist/core/schemas/builders/lazy/lazy.js +21 -13
- package/dist/core/schemas/builders/lazy/lazyObject.js +11 -11
- package/dist/core/schemas/builders/list/list.js +53 -38
- package/dist/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
- package/dist/core/schemas/builders/literals/booleanLiteral.js +29 -0
- package/dist/core/schemas/builders/literals/index.d.ts +1 -0
- package/dist/core/schemas/builders/literals/index.js +3 -1
- package/dist/core/schemas/builders/literals/stringLiteral.js +4 -3
- package/dist/core/schemas/builders/object/index.d.ts +5 -2
- package/dist/core/schemas/builders/object/index.js +3 -1
- package/dist/core/schemas/builders/object/object.js +150 -129
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +8 -0
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +19 -18
- package/dist/core/schemas/builders/object-like/index.d.ts +1 -1
- package/dist/core/schemas/builders/primitives/boolean.js +4 -3
- package/dist/core/schemas/builders/primitives/number.js +4 -3
- package/dist/core/schemas/builders/primitives/string.js +4 -3
- package/dist/core/schemas/builders/record/index.d.ts +1 -1
- package/dist/core/schemas/builders/record/record.js +82 -67
- package/dist/core/schemas/builders/schema-utils/JsonError.js +0 -1
- package/dist/core/schemas/builders/schema-utils/ParseError.js +0 -1
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +23 -20
- package/dist/core/schemas/builders/schema-utils/index.d.ts +2 -1
- package/dist/core/schemas/builders/set/set.js +21 -12
- package/dist/core/schemas/builders/undiscriminated-union/index.d.ts +1 -1
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +38 -24
- package/dist/core/schemas/builders/union/index.d.ts +3 -2
- package/dist/core/schemas/builders/union/union.js +95 -74
- package/dist/core/schemas/index.d.ts +1 -1
- package/dist/core/schemas/utils/createIdentitySchemaCreator.js +2 -4
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.d.ts +1 -0
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +24 -0
- package/dist/core/schemas/utils/isPlainObject.d.ts +0 -1
- package/dist/core/schemas/utils/isPlainObject.js +1 -2
- package/dist/core/schemas/utils/maybeSkipValidation.d.ts +2 -0
- package/dist/core/schemas/utils/maybeSkipValidation.js +37 -0
- package/dist/core/streaming-fetcher/Stream.d.ts +14 -0
- package/dist/core/streaming-fetcher/Stream.js +75 -0
- package/dist/core/streaming-fetcher/StreamingFetcher.d.ts +10 -8
- package/dist/core/streaming-fetcher/StreamingFetcher.js +38 -44
- package/dist/core/streaming-fetcher/getHeader.d.ts +2 -0
- package/dist/core/streaming-fetcher/getHeader.js +12 -0
- package/dist/core/streaming-fetcher/index.d.ts +4 -1
- package/dist/core/streaming-fetcher/index.js +5 -1
- package/dist/errors/VellumError.js +14 -3
- package/dist/serialization/client/requests/ExecuteWorkflowStreamRequest.js +11 -2
- package/dist/serialization/client/requests/GenerateBodyRequest.js +11 -2
- package/dist/serialization/client/requests/GenerateStreamBodyRequest.js +11 -2
- package/dist/serialization/client/requests/SearchRequestBodyRequest.js +10 -1
- package/dist/serialization/client/requests/SubmitCompletionActualsRequest.js +10 -1
- package/dist/serialization/client/requests/SubmitWorkflowExecutionActualsRequest.js +10 -1
- package/dist/serialization/resources/documentIndexes/client/requests/DocumentIndexCreateRequest.js +11 -2
- package/dist/serialization/resources/documents/client/requests/PatchedDocumentUpdateRequest.js +10 -1
- package/dist/serialization/resources/index.d.ts +0 -2
- package/dist/serialization/resources/index.js +1 -3
- package/dist/serialization/resources/registeredPrompts/client/requests/RegisterPromptRequestRequest.d.ts +1 -1
- package/dist/serialization/resources/registeredPrompts/client/requests/RegisterPromptRequestRequest.js +12 -3
- package/dist/serialization/resources/sandboxes/client/requests/UpsertSandboxScenarioRequestRequest.js +11 -2
- package/dist/serialization/resources/testSuites/client/requests/TestSuiteTestCaseRequest.js +10 -1
- package/dist/serialization/types/ApiNodeResult.js +10 -1
- package/dist/serialization/types/ChatMessage.js +10 -1
- package/dist/serialization/types/ChatMessageRequest.js +10 -1
- package/dist/serialization/types/ConditionalNodeResult.js +10 -1
- package/dist/serialization/types/DeploymentRead.js +12 -3
- package/dist/serialization/types/DocumentDocumentToDocumentIndex.js +10 -1
- package/dist/serialization/types/DocumentIndexRead.js +11 -2
- package/dist/serialization/types/DocumentRead.js +12 -3
- package/dist/serialization/types/EnrichedNormalizedCompletion.d.ts +3 -1
- package/dist/serialization/types/EnrichedNormalizedCompletion.js +15 -4
- package/dist/serialization/types/GenerateOptionsRequest.js +10 -1
- package/dist/serialization/types/GenerateRequest.js +10 -1
- package/dist/serialization/types/GenerateResponse.js +10 -1
- package/dist/serialization/types/GenerateResult.js +11 -2
- package/dist/serialization/types/GenerateResultData.js +10 -1
- package/dist/serialization/types/GenerateStreamResponse.js +10 -1
- package/dist/serialization/types/GenerateStreamResult.js +11 -2
- package/dist/serialization/types/GenerateStreamResultData.js +10 -1
- package/dist/serialization/types/MetadataFilterConfigRequest.js +12 -3
- package/dist/serialization/types/MetadataFilterRuleRequest.js +12 -3
- package/dist/serialization/types/ModelVersionBuildConfig.js +10 -1
- package/dist/serialization/types/ModelVersionExecConfig.js +12 -3
- package/dist/serialization/types/ModelVersionRead.js +13 -4
- package/dist/serialization/types/NodeInputCompiledChatHistoryValue.js +10 -1
- package/dist/serialization/types/NodeInputCompiledErrorValue.js +10 -1
- package/dist/serialization/types/NodeInputCompiledSearchResultsValue.js +10 -1
- package/dist/serialization/types/NodeInputVariableCompiledValue.js +15 -6
- package/dist/serialization/types/NormalizedLogProbs.js +10 -1
- package/dist/serialization/types/PaginatedSlimDocumentList.js +10 -1
- package/dist/serialization/types/PromptNodeResult.js +10 -1
- package/dist/serialization/types/PromptTemplateBlock.js +11 -2
- package/dist/serialization/types/PromptTemplateBlockData.js +10 -1
- package/dist/serialization/types/PromptTemplateBlockDataRequest.js +10 -1
- package/dist/serialization/types/PromptTemplateBlockProperties.js +12 -3
- package/dist/serialization/types/PromptTemplateBlockPropertiesRequest.js +12 -3
- package/dist/serialization/types/PromptTemplateBlockRequest.js +11 -2
- package/dist/serialization/types/ProviderEnum.d.ts +1 -1
- package/dist/serialization/types/ProviderEnum.js +3 -0
- package/dist/serialization/types/RegisterPromptPromptInfoRequest.d.ts +0 -1
- package/dist/serialization/types/RegisterPromptPromptInfoRequest.js +11 -3
- package/dist/serialization/types/RegisterPromptResponse.d.ts +1 -0
- package/dist/serialization/types/RegisterPromptResponse.js +15 -5
- package/dist/serialization/types/RegisteredPromptInputVariableRequest.js +10 -1
- package/dist/serialization/types/SandboxMetricInputParams.js +10 -1
- package/dist/serialization/types/SandboxMetricInputParamsRequest.js +10 -1
- package/dist/serialization/types/SandboxScenario.js +11 -2
- package/dist/serialization/types/ScenarioInput.js +11 -2
- package/dist/serialization/types/ScenarioInputRequest.js +11 -2
- package/dist/serialization/types/SearchFiltersRequest.js +10 -1
- package/dist/serialization/types/SearchNodeResult.js +10 -1
- package/dist/serialization/types/SearchNodeResultData.js +10 -1
- package/dist/serialization/types/SearchRequestOptionsRequest.js +12 -3
- package/dist/serialization/types/SearchResponse.js +10 -1
- package/dist/serialization/types/SearchResult.js +10 -1
- package/dist/serialization/types/SlimDocument.js +13 -4
- package/dist/serialization/types/SubmitWorkflowExecutionActualRequest.js +12 -3
- package/dist/serialization/types/TemplatingNodeChatHistoryResult.js +10 -1
- package/dist/serialization/types/TemplatingNodeErrorResult.js +10 -1
- package/dist/serialization/types/TemplatingNodeResult.js +10 -1
- package/dist/serialization/types/TemplatingNodeResultData.js +10 -1
- package/dist/serialization/types/TemplatingNodeResultOutput.js +15 -6
- package/dist/serialization/types/TemplatingNodeSearchResultsResult.js +10 -1
- package/dist/serialization/types/TerminalNodeChatHistoryResult.js +10 -1
- package/dist/serialization/types/TerminalNodeErrorResult.js +10 -1
- package/dist/serialization/types/TerminalNodeResult.js +10 -1
- package/dist/serialization/types/TerminalNodeResultData.js +10 -1
- package/dist/serialization/types/TerminalNodeResultOutput.js +15 -6
- package/dist/serialization/types/TerminalNodeSearchResultsResult.js +10 -1
- package/dist/serialization/types/TestSuiteTestCase.js +10 -1
- package/dist/serialization/types/VellumError.js +10 -1
- package/dist/serialization/types/VellumVariable.js +10 -1
- package/dist/serialization/types/WorkflowEventError.js +10 -1
- package/dist/serialization/types/WorkflowExecutionActualChatHistoryRequest.js +10 -1
- package/dist/serialization/types/WorkflowExecutionNodeResultEvent.js +10 -1
- package/dist/serialization/types/WorkflowExecutionWorkflowResultEvent.js +10 -1
- package/dist/serialization/types/WorkflowNodeResultData.js +15 -6
- package/dist/serialization/types/WorkflowNodeResultEvent.js +13 -4
- package/dist/serialization/types/WorkflowRequestChatHistoryInputRequest.js +10 -1
- package/dist/serialization/types/WorkflowRequestInputRequest.js +12 -3
- package/dist/serialization/types/WorkflowResultEvent.js +12 -3
- package/dist/serialization/types/WorkflowResultEventOutputData.js +15 -6
- package/dist/serialization/types/WorkflowResultEventOutputDataChatHistory.js +11 -2
- package/dist/serialization/types/WorkflowResultEventOutputDataError.js +11 -2
- package/dist/serialization/types/WorkflowResultEventOutputDataJson.js +10 -1
- package/dist/serialization/types/WorkflowResultEventOutputDataNumber.js +10 -1
- package/dist/serialization/types/WorkflowResultEventOutputDataSearchResults.js +11 -2
- package/dist/serialization/types/WorkflowResultEventOutputDataString.js +10 -1
- package/dist/serialization/types/WorkflowStreamEvent.js +11 -2
- package/dist/serialization/types/index.d.ts +0 -2
- package/dist/serialization/types/index.js +0 -2
- package/errors/VellumError.js +14 -3
- package/package.json +4 -3
- package/serialization/client/requests/ExecuteWorkflowStreamRequest.js +11 -2
- package/serialization/client/requests/GenerateBodyRequest.js +11 -2
- package/serialization/client/requests/GenerateStreamBodyRequest.js +11 -2
- package/serialization/client/requests/SearchRequestBodyRequest.js +10 -1
- package/serialization/client/requests/SubmitCompletionActualsRequest.js +10 -1
- package/serialization/client/requests/SubmitWorkflowExecutionActualsRequest.js +10 -1
- package/serialization/resources/documentIndexes/client/requests/DocumentIndexCreateRequest.js +11 -2
- package/serialization/resources/documents/client/requests/PatchedDocumentUpdateRequest.js +10 -1
- package/serialization/resources/index.d.ts +0 -2
- package/serialization/resources/index.js +1 -3
- package/serialization/resources/registeredPrompts/client/requests/RegisterPromptRequestRequest.d.ts +1 -1
- package/serialization/resources/registeredPrompts/client/requests/RegisterPromptRequestRequest.js +12 -3
- package/serialization/resources/sandboxes/client/requests/UpsertSandboxScenarioRequestRequest.js +11 -2
- package/serialization/resources/testSuites/client/requests/TestSuiteTestCaseRequest.js +10 -1
- package/serialization/types/ApiNodeResult.js +10 -1
- package/serialization/types/ChatMessage.js +10 -1
- package/serialization/types/ChatMessageRequest.js +10 -1
- package/serialization/types/ConditionalNodeResult.js +10 -1
- package/serialization/types/DeploymentRead.js +12 -3
- package/serialization/types/DocumentDocumentToDocumentIndex.js +10 -1
- package/serialization/types/DocumentIndexRead.js +11 -2
- package/serialization/types/DocumentRead.js +12 -3
- package/serialization/types/EnrichedNormalizedCompletion.d.ts +3 -1
- package/serialization/types/EnrichedNormalizedCompletion.js +15 -4
- package/serialization/types/GenerateOptionsRequest.js +10 -1
- package/serialization/types/GenerateRequest.js +10 -1
- package/serialization/types/GenerateResponse.js +10 -1
- package/serialization/types/GenerateResult.js +11 -2
- package/serialization/types/GenerateResultData.js +10 -1
- package/serialization/types/GenerateStreamResponse.js +10 -1
- package/serialization/types/GenerateStreamResult.js +11 -2
- package/serialization/types/GenerateStreamResultData.js +10 -1
- package/serialization/types/MetadataFilterConfigRequest.js +12 -3
- package/serialization/types/MetadataFilterRuleRequest.js +12 -3
- package/serialization/types/ModelVersionBuildConfig.js +10 -1
- package/serialization/types/ModelVersionExecConfig.js +12 -3
- package/serialization/types/ModelVersionRead.js +13 -4
- package/serialization/types/NodeInputCompiledChatHistoryValue.js +10 -1
- package/serialization/types/NodeInputCompiledErrorValue.js +10 -1
- package/serialization/types/NodeInputCompiledSearchResultsValue.js +10 -1
- package/serialization/types/NodeInputVariableCompiledValue.js +15 -6
- package/serialization/types/NormalizedLogProbs.js +10 -1
- package/serialization/types/PaginatedSlimDocumentList.js +10 -1
- package/serialization/types/PromptNodeResult.js +10 -1
- package/serialization/types/PromptTemplateBlock.js +11 -2
- package/serialization/types/PromptTemplateBlockData.js +10 -1
- package/serialization/types/PromptTemplateBlockDataRequest.js +10 -1
- package/serialization/types/PromptTemplateBlockProperties.js +12 -3
- package/serialization/types/PromptTemplateBlockPropertiesRequest.js +12 -3
- package/serialization/types/PromptTemplateBlockRequest.js +11 -2
- package/serialization/types/ProviderEnum.d.ts +1 -1
- package/serialization/types/ProviderEnum.js +3 -0
- package/serialization/types/RegisterPromptPromptInfoRequest.d.ts +0 -1
- package/serialization/types/RegisterPromptPromptInfoRequest.js +11 -3
- package/serialization/types/RegisterPromptResponse.d.ts +1 -0
- package/serialization/types/RegisterPromptResponse.js +15 -5
- package/serialization/types/RegisteredPromptInputVariableRequest.js +10 -1
- package/serialization/types/SandboxMetricInputParams.js +10 -1
- package/serialization/types/SandboxMetricInputParamsRequest.js +10 -1
- package/serialization/types/SandboxScenario.js +11 -2
- package/serialization/types/ScenarioInput.js +11 -2
- package/serialization/types/ScenarioInputRequest.js +11 -2
- package/serialization/types/SearchFiltersRequest.js +10 -1
- package/serialization/types/SearchNodeResult.js +10 -1
- package/serialization/types/SearchNodeResultData.js +10 -1
- package/serialization/types/SearchRequestOptionsRequest.js +12 -3
- package/serialization/types/SearchResponse.js +10 -1
- package/serialization/types/SearchResult.js +10 -1
- package/serialization/types/SlimDocument.js +13 -4
- package/serialization/types/SubmitWorkflowExecutionActualRequest.js +12 -3
- package/serialization/types/TemplatingNodeChatHistoryResult.js +10 -1
- package/serialization/types/TemplatingNodeErrorResult.js +10 -1
- package/serialization/types/TemplatingNodeResult.js +10 -1
- package/serialization/types/TemplatingNodeResultData.js +10 -1
- package/serialization/types/TemplatingNodeResultOutput.js +15 -6
- package/serialization/types/TemplatingNodeSearchResultsResult.js +10 -1
- package/serialization/types/TerminalNodeChatHistoryResult.js +10 -1
- package/serialization/types/TerminalNodeErrorResult.js +10 -1
- package/serialization/types/TerminalNodeResult.js +10 -1
- package/serialization/types/TerminalNodeResultData.js +10 -1
- package/serialization/types/TerminalNodeResultOutput.js +15 -6
- package/serialization/types/TerminalNodeSearchResultsResult.js +10 -1
- package/serialization/types/TestSuiteTestCase.js +10 -1
- package/serialization/types/VellumError.js +10 -1
- package/serialization/types/VellumVariable.js +10 -1
- package/serialization/types/WorkflowEventError.js +10 -1
- package/serialization/types/WorkflowExecutionActualChatHistoryRequest.js +10 -1
- package/serialization/types/WorkflowExecutionNodeResultEvent.js +10 -1
- package/serialization/types/WorkflowExecutionWorkflowResultEvent.js +10 -1
- package/serialization/types/WorkflowNodeResultData.js +15 -6
- package/serialization/types/WorkflowNodeResultEvent.js +13 -4
- package/serialization/types/WorkflowRequestChatHistoryInputRequest.js +10 -1
- package/serialization/types/WorkflowRequestInputRequest.js +12 -3
- package/serialization/types/WorkflowResultEvent.js +12 -3
- package/serialization/types/WorkflowResultEventOutputData.js +15 -6
- package/serialization/types/WorkflowResultEventOutputDataChatHistory.js +11 -2
- package/serialization/types/WorkflowResultEventOutputDataError.js +11 -2
- package/serialization/types/WorkflowResultEventOutputDataJson.js +10 -1
- package/serialization/types/WorkflowResultEventOutputDataNumber.js +10 -1
- package/serialization/types/WorkflowResultEventOutputDataSearchResults.js +11 -2
- package/serialization/types/WorkflowResultEventOutputDataString.js +10 -1
- package/serialization/types/WorkflowStreamEvent.js +11 -2
- package/serialization/types/index.d.ts +0 -2
- package/serialization/types/index.js +0 -2
- package/api/resources/modelVersions/client/requests/ModelVersionCompilePromptRequestRequest.d.ts +0 -7
- package/api/resources/modelVersions/client/requests/ModelVersionCompilePromptRequestRequest.js +0 -5
- package/api/resources/modelVersions/client/requests/index.d.ts +0 -1
- package/api/resources/modelVersions/client/requests/index.js +0 -2
- package/api/types/ModelVersionCompilePromptResponse.d.ts +0 -8
- package/api/types/ModelVersionCompilePromptResponse.js +0 -5
- package/api/types/ModelVersionCompiledPrompt.d.ts +0 -9
- package/api/types/ModelVersionCompiledPrompt.js +0 -5
- package/core/callback-queue/CallbackQueue.d.ts +0 -6
- package/core/callback-queue/CallbackQueue.js +0 -20
- package/core/callback-queue/index.d.ts +0 -1
- package/core/callback-queue/index.js +0 -5
- package/dist/api/resources/modelVersions/client/requests/ModelVersionCompilePromptRequestRequest.d.ts +0 -7
- package/dist/api/resources/modelVersions/client/requests/ModelVersionCompilePromptRequestRequest.js +0 -5
- package/dist/api/resources/modelVersions/client/requests/index.d.ts +0 -1
- package/dist/api/resources/modelVersions/client/requests/index.js +0 -2
- package/dist/api/types/ModelVersionCompilePromptResponse.d.ts +0 -8
- package/dist/api/types/ModelVersionCompilePromptResponse.js +0 -5
- package/dist/api/types/ModelVersionCompiledPrompt.d.ts +0 -9
- package/dist/api/types/ModelVersionCompiledPrompt.js +0 -5
- package/dist/core/callback-queue/CallbackQueue.d.ts +0 -6
- package/dist/core/callback-queue/CallbackQueue.js +0 -20
- package/dist/core/callback-queue/index.d.ts +0 -1
- package/dist/core/callback-queue/index.js +0 -5
- package/dist/serialization/resources/modelVersions/client/index.d.ts +0 -1
- package/dist/serialization/resources/modelVersions/client/index.js +0 -17
- package/dist/serialization/resources/modelVersions/client/requests/ModelVersionCompilePromptRequestRequest.d.ts +0 -12
- package/dist/serialization/resources/modelVersions/client/requests/ModelVersionCompilePromptRequestRequest.js +0 -33
- package/dist/serialization/resources/modelVersions/client/requests/index.d.ts +0 -1
- package/dist/serialization/resources/modelVersions/client/requests/index.js +0 -5
- package/dist/serialization/resources/modelVersions/index.d.ts +0 -1
- package/dist/serialization/resources/modelVersions/index.js +0 -17
- package/dist/serialization/types/ModelVersionCompilePromptResponse.d.ts +0 -12
- package/dist/serialization/types/ModelVersionCompilePromptResponse.js +0 -33
- package/dist/serialization/types/ModelVersionCompiledPrompt.d.ts +0 -13
- package/dist/serialization/types/ModelVersionCompiledPrompt.js +0 -34
- package/serialization/resources/modelVersions/client/index.d.ts +0 -1
- package/serialization/resources/modelVersions/client/index.js +0 -17
- package/serialization/resources/modelVersions/client/requests/ModelVersionCompilePromptRequestRequest.d.ts +0 -12
- package/serialization/resources/modelVersions/client/requests/ModelVersionCompilePromptRequestRequest.js +0 -33
- package/serialization/resources/modelVersions/client/requests/index.d.ts +0 -1
- package/serialization/resources/modelVersions/client/requests/index.js +0 -5
- package/serialization/resources/modelVersions/index.d.ts +0 -1
- package/serialization/resources/modelVersions/index.js +0 -17
- package/serialization/types/ModelVersionCompilePromptResponse.d.ts +0 -12
- package/serialization/types/ModelVersionCompilePromptResponse.js +0 -33
- package/serialization/types/ModelVersionCompiledPrompt.d.ts +0 -13
- package/serialization/types/ModelVersionCompiledPrompt.js +0 -34
package/Client.js
CHANGED
|
@@ -25,6 +25,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
__setModuleDefault(result, mod);
|
|
26
26
|
return result;
|
|
27
27
|
};
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
28
37
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
38
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
39
|
};
|
|
@@ -33,8 +42,8 @@ exports.VellumClient = void 0;
|
|
|
33
42
|
const environments = __importStar(require("./environments"));
|
|
34
43
|
const core = __importStar(require("./core"));
|
|
35
44
|
const Vellum = __importStar(require("./api"));
|
|
36
|
-
const url_join_1 = __importDefault(require("url-join"));
|
|
37
45
|
const serializers = __importStar(require("./serialization"));
|
|
46
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
38
47
|
const errors = __importStar(require("./errors"));
|
|
39
48
|
const Client_1 = require("./api/resources/deployments/client/Client");
|
|
40
49
|
const Client_2 = require("./api/resources/documentIndexes/client/Client");
|
|
@@ -44,315 +53,352 @@ const Client_5 = require("./api/resources/registeredPrompts/client/Client");
|
|
|
44
53
|
const Client_6 = require("./api/resources/sandboxes/client/Client");
|
|
45
54
|
const Client_7 = require("./api/resources/testSuites/client/Client");
|
|
46
55
|
class VellumClient {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
this.options = options;
|
|
56
|
+
constructor(_options) {
|
|
57
|
+
this._options = _options;
|
|
50
58
|
}
|
|
51
59
|
/**
|
|
52
60
|
* Executes a deployed Workflow and streams back its results.
|
|
53
|
-
* @throws {Vellum.BadRequestError}
|
|
54
|
-
* @throws {Vellum.NotFoundError}
|
|
55
|
-
* @throws {Vellum.InternalServerError}
|
|
56
61
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
62
|
+
executeWorkflowStream(request, requestOptions) {
|
|
63
|
+
var _a;
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
const _response = yield core.streamingFetcher({
|
|
66
|
+
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
67
|
+
.predict, "v1/execute-workflow-stream"),
|
|
68
|
+
method: "POST",
|
|
69
|
+
headers: {
|
|
70
|
+
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
71
|
+
"X-Fern-Language": "JavaScript",
|
|
72
|
+
"X-Fern-SDK-Name": "vellum-ai",
|
|
73
|
+
"X-Fern-SDK-Version": "v0.1.1",
|
|
74
|
+
},
|
|
75
|
+
body: yield serializers.ExecuteWorkflowStreamRequest.jsonOrThrow(request, {
|
|
76
|
+
unrecognizedObjectKeys: "strip",
|
|
77
|
+
}),
|
|
78
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
79
|
+
});
|
|
80
|
+
return new core.Stream({
|
|
81
|
+
stream: _response.data,
|
|
82
|
+
terminator: "\n",
|
|
83
|
+
parse: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
return yield serializers.WorkflowStreamEvent.parseOrThrow(data, {
|
|
85
|
+
unrecognizedObjectKeys: "passthrough",
|
|
86
|
+
allowUnrecognizedUnionMembers: true,
|
|
87
|
+
allowUnrecognizedEnumValues: true,
|
|
88
|
+
breadcrumbsPrefix: ["response"],
|
|
89
|
+
});
|
|
90
|
+
}),
|
|
91
|
+
});
|
|
84
92
|
});
|
|
85
93
|
}
|
|
86
94
|
/**
|
|
87
95
|
* Generate a completion using a previously defined deployment.
|
|
88
96
|
*
|
|
89
97
|
* **Note:** Uses a base url of `https://predict.vellum.ai`.
|
|
90
|
-
* @throws {Vellum.BadRequestError}
|
|
91
|
-
* @throws {Vellum.ForbiddenError}
|
|
92
|
-
* @throws {Vellum.NotFoundError}
|
|
93
|
-
* @throws {Vellum.InternalServerError}
|
|
98
|
+
* @throws {@link Vellum.BadRequestError}
|
|
99
|
+
* @throws {@link Vellum.ForbiddenError}
|
|
100
|
+
* @throws {@link Vellum.NotFoundError}
|
|
101
|
+
* @throws {@link Vellum.InternalServerError}
|
|
94
102
|
*/
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
generate(request, requestOptions) {
|
|
104
|
+
var _a;
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
const _response = yield core.fetcher({
|
|
107
|
+
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
108
|
+
.predict, "v1/generate"),
|
|
109
|
+
method: "POST",
|
|
110
|
+
headers: {
|
|
111
|
+
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
112
|
+
"X-Fern-Language": "JavaScript",
|
|
113
|
+
"X-Fern-SDK-Name": "vellum-ai",
|
|
114
|
+
"X-Fern-SDK-Version": "v0.1.1",
|
|
115
|
+
},
|
|
116
|
+
contentType: "application/json",
|
|
117
|
+
body: yield serializers.GenerateBodyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
118
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
119
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
110
120
|
});
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
if (_response.ok) {
|
|
122
|
+
return yield serializers.GenerateResponse.parseOrThrow(_response.body, {
|
|
123
|
+
unrecognizedObjectKeys: "passthrough",
|
|
124
|
+
allowUnrecognizedUnionMembers: true,
|
|
125
|
+
allowUnrecognizedEnumValues: true,
|
|
126
|
+
breadcrumbsPrefix: ["response"],
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
if (_response.error.reason === "status-code") {
|
|
130
|
+
switch (_response.error.statusCode) {
|
|
131
|
+
case 400:
|
|
132
|
+
throw new Vellum.BadRequestError(_response.error.body);
|
|
133
|
+
case 403:
|
|
134
|
+
throw new Vellum.ForbiddenError(yield serializers.GenerateErrorResponse.parseOrThrow(_response.error.body, {
|
|
135
|
+
unrecognizedObjectKeys: "passthrough",
|
|
136
|
+
allowUnrecognizedUnionMembers: true,
|
|
137
|
+
allowUnrecognizedEnumValues: true,
|
|
138
|
+
breadcrumbsPrefix: ["response"],
|
|
139
|
+
}));
|
|
140
|
+
case 404:
|
|
141
|
+
throw new Vellum.NotFoundError(_response.error.body);
|
|
142
|
+
case 500:
|
|
143
|
+
throw new Vellum.InternalServerError(_response.error.body);
|
|
144
|
+
default:
|
|
145
|
+
throw new errors.VellumError({
|
|
146
|
+
statusCode: _response.error.statusCode,
|
|
147
|
+
body: _response.error.body,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
switch (_response.error.reason) {
|
|
152
|
+
case "non-json":
|
|
127
153
|
throw new errors.VellumError({
|
|
128
154
|
statusCode: _response.error.statusCode,
|
|
129
|
-
body: _response.error.
|
|
155
|
+
body: _response.error.rawBody,
|
|
156
|
+
});
|
|
157
|
+
case "timeout":
|
|
158
|
+
throw new errors.VellumTimeoutError();
|
|
159
|
+
case "unknown":
|
|
160
|
+
throw new errors.VellumError({
|
|
161
|
+
message: _response.error.errorMessage,
|
|
130
162
|
});
|
|
131
163
|
}
|
|
132
|
-
}
|
|
133
|
-
switch (_response.error.reason) {
|
|
134
|
-
case "non-json":
|
|
135
|
-
throw new errors.VellumError({
|
|
136
|
-
statusCode: _response.error.statusCode,
|
|
137
|
-
body: _response.error.rawBody,
|
|
138
|
-
});
|
|
139
|
-
case "timeout":
|
|
140
|
-
throw new errors.VellumTimeoutError();
|
|
141
|
-
case "unknown":
|
|
142
|
-
throw new errors.VellumError({
|
|
143
|
-
message: _response.error.errorMessage,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
164
|
+
});
|
|
146
165
|
}
|
|
147
166
|
/**
|
|
148
167
|
* Generate a stream of completions using a previously defined deployment.
|
|
149
168
|
*
|
|
150
169
|
* **Note:** Uses a base url of `https://predict.vellum.ai`.
|
|
151
|
-
* @throws {Vellum.BadRequestError}
|
|
152
|
-
* @throws {Vellum.ForbiddenError}
|
|
153
|
-
* @throws {Vellum.NotFoundError}
|
|
154
|
-
* @throws {Vellum.InternalServerError}
|
|
155
170
|
*/
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
171
|
+
generateStream(request, requestOptions) {
|
|
172
|
+
var _a;
|
|
173
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
174
|
+
const _response = yield core.streamingFetcher({
|
|
175
|
+
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
176
|
+
.predict, "v1/generate-stream"),
|
|
177
|
+
method: "POST",
|
|
178
|
+
headers: {
|
|
179
|
+
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
180
|
+
"X-Fern-Language": "JavaScript",
|
|
181
|
+
"X-Fern-SDK-Name": "vellum-ai",
|
|
182
|
+
"X-Fern-SDK-Version": "v0.1.1",
|
|
183
|
+
},
|
|
184
|
+
body: yield serializers.GenerateStreamBodyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
185
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
186
|
+
});
|
|
187
|
+
return new core.Stream({
|
|
188
|
+
stream: _response.data,
|
|
189
|
+
terminator: "\n",
|
|
190
|
+
parse: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
191
|
+
return yield serializers.GenerateStreamResponse.parseOrThrow(data, {
|
|
192
|
+
unrecognizedObjectKeys: "passthrough",
|
|
193
|
+
allowUnrecognizedUnionMembers: true,
|
|
194
|
+
allowUnrecognizedEnumValues: true,
|
|
195
|
+
breadcrumbsPrefix: ["response"],
|
|
196
|
+
});
|
|
197
|
+
}),
|
|
198
|
+
});
|
|
181
199
|
});
|
|
182
200
|
}
|
|
183
201
|
/**
|
|
184
202
|
* Perform a search against a document index.
|
|
185
203
|
*
|
|
186
204
|
* **Note:** Uses a base url of `https://predict.vellum.ai`.
|
|
187
|
-
* @throws {Vellum.BadRequestError}
|
|
188
|
-
* @throws {Vellum.NotFoundError}
|
|
189
|
-
* @throws {Vellum.InternalServerError}
|
|
205
|
+
* @throws {@link Vellum.BadRequestError}
|
|
206
|
+
* @throws {@link Vellum.NotFoundError}
|
|
207
|
+
* @throws {@link Vellum.InternalServerError}
|
|
190
208
|
*/
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
209
|
+
search(request, requestOptions) {
|
|
210
|
+
var _a;
|
|
211
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
212
|
+
const _response = yield core.fetcher({
|
|
213
|
+
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
214
|
+
.predict, "v1/search"),
|
|
215
|
+
method: "POST",
|
|
216
|
+
headers: {
|
|
217
|
+
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
218
|
+
"X-Fern-Language": "JavaScript",
|
|
219
|
+
"X-Fern-SDK-Name": "vellum-ai",
|
|
220
|
+
"X-Fern-SDK-Version": "v0.1.1",
|
|
221
|
+
},
|
|
222
|
+
contentType: "application/json",
|
|
223
|
+
body: yield serializers.SearchRequestBodyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
224
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
225
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
206
226
|
});
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
227
|
+
if (_response.ok) {
|
|
228
|
+
return yield serializers.SearchResponse.parseOrThrow(_response.body, {
|
|
229
|
+
unrecognizedObjectKeys: "passthrough",
|
|
230
|
+
allowUnrecognizedUnionMembers: true,
|
|
231
|
+
allowUnrecognizedEnumValues: true,
|
|
232
|
+
breadcrumbsPrefix: ["response"],
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
if (_response.error.reason === "status-code") {
|
|
236
|
+
switch (_response.error.statusCode) {
|
|
237
|
+
case 400:
|
|
238
|
+
throw new Vellum.BadRequestError(_response.error.body);
|
|
239
|
+
case 404:
|
|
240
|
+
throw new Vellum.NotFoundError(_response.error.body);
|
|
241
|
+
case 500:
|
|
242
|
+
throw new Vellum.InternalServerError(_response.error.body);
|
|
243
|
+
default:
|
|
244
|
+
throw new errors.VellumError({
|
|
245
|
+
statusCode: _response.error.statusCode,
|
|
246
|
+
body: _response.error.body,
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
switch (_response.error.reason) {
|
|
251
|
+
case "non-json":
|
|
217
252
|
throw new errors.VellumError({
|
|
218
253
|
statusCode: _response.error.statusCode,
|
|
219
|
-
body: _response.error.
|
|
254
|
+
body: _response.error.rawBody,
|
|
255
|
+
});
|
|
256
|
+
case "timeout":
|
|
257
|
+
throw new errors.VellumTimeoutError();
|
|
258
|
+
case "unknown":
|
|
259
|
+
throw new errors.VellumError({
|
|
260
|
+
message: _response.error.errorMessage,
|
|
220
261
|
});
|
|
221
262
|
}
|
|
222
|
-
}
|
|
223
|
-
switch (_response.error.reason) {
|
|
224
|
-
case "non-json":
|
|
225
|
-
throw new errors.VellumError({
|
|
226
|
-
statusCode: _response.error.statusCode,
|
|
227
|
-
body: _response.error.rawBody,
|
|
228
|
-
});
|
|
229
|
-
case "timeout":
|
|
230
|
-
throw new errors.VellumTimeoutError();
|
|
231
|
-
case "unknown":
|
|
232
|
-
throw new errors.VellumError({
|
|
233
|
-
message: _response.error.errorMessage,
|
|
234
|
-
});
|
|
235
|
-
}
|
|
263
|
+
});
|
|
236
264
|
}
|
|
237
265
|
/**
|
|
238
266
|
* Used to submit feedback regarding the quality of previously generated completions.
|
|
239
267
|
*
|
|
240
268
|
* **Note:** Uses a base url of `https://predict.vellum.ai`.
|
|
241
|
-
* @throws {Vellum.BadRequestError}
|
|
242
|
-
* @throws {Vellum.NotFoundError}
|
|
243
|
-
* @throws {Vellum.InternalServerError}
|
|
269
|
+
* @throws {@link Vellum.BadRequestError}
|
|
270
|
+
* @throws {@link Vellum.NotFoundError}
|
|
271
|
+
* @throws {@link Vellum.InternalServerError}
|
|
244
272
|
*/
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
273
|
+
submitCompletionActuals(request, requestOptions) {
|
|
274
|
+
var _a;
|
|
275
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
276
|
+
const _response = yield core.fetcher({
|
|
277
|
+
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
278
|
+
.predict, "v1/submit-completion-actuals"),
|
|
279
|
+
method: "POST",
|
|
280
|
+
headers: {
|
|
281
|
+
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
282
|
+
"X-Fern-Language": "JavaScript",
|
|
283
|
+
"X-Fern-SDK-Name": "vellum-ai",
|
|
284
|
+
"X-Fern-SDK-Version": "v0.1.1",
|
|
285
|
+
},
|
|
286
|
+
contentType: "application/json",
|
|
287
|
+
body: yield serializers.SubmitCompletionActualsRequest.jsonOrThrow(request, {
|
|
288
|
+
unrecognizedObjectKeys: "strip",
|
|
289
|
+
}),
|
|
290
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
291
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
292
|
+
});
|
|
293
|
+
if (_response.ok) {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
if (_response.error.reason === "status-code") {
|
|
297
|
+
switch (_response.error.statusCode) {
|
|
298
|
+
case 400:
|
|
299
|
+
throw new Vellum.BadRequestError(_response.error.body);
|
|
300
|
+
case 404:
|
|
301
|
+
throw new Vellum.NotFoundError(_response.error.body);
|
|
302
|
+
case 500:
|
|
303
|
+
throw new Vellum.InternalServerError(_response.error.body);
|
|
304
|
+
default:
|
|
305
|
+
throw new errors.VellumError({
|
|
306
|
+
statusCode: _response.error.statusCode,
|
|
307
|
+
body: _response.error.body,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
switch (_response.error.reason) {
|
|
312
|
+
case "non-json":
|
|
269
313
|
throw new errors.VellumError({
|
|
270
314
|
statusCode: _response.error.statusCode,
|
|
271
|
-
body: _response.error.
|
|
315
|
+
body: _response.error.rawBody,
|
|
316
|
+
});
|
|
317
|
+
case "timeout":
|
|
318
|
+
throw new errors.VellumTimeoutError();
|
|
319
|
+
case "unknown":
|
|
320
|
+
throw new errors.VellumError({
|
|
321
|
+
message: _response.error.errorMessage,
|
|
272
322
|
});
|
|
273
323
|
}
|
|
274
|
-
}
|
|
275
|
-
switch (_response.error.reason) {
|
|
276
|
-
case "non-json":
|
|
277
|
-
throw new errors.VellumError({
|
|
278
|
-
statusCode: _response.error.statusCode,
|
|
279
|
-
body: _response.error.rawBody,
|
|
280
|
-
});
|
|
281
|
-
case "timeout":
|
|
282
|
-
throw new errors.VellumTimeoutError();
|
|
283
|
-
case "unknown":
|
|
284
|
-
throw new errors.VellumError({
|
|
285
|
-
message: _response.error.errorMessage,
|
|
286
|
-
});
|
|
287
|
-
}
|
|
324
|
+
});
|
|
288
325
|
}
|
|
289
326
|
/**
|
|
290
327
|
* Used to submit feedback regarding the quality of previous workflow execution and its outputs.
|
|
291
328
|
*
|
|
292
329
|
* **Note:** Uses a base url of `https://predict.vellum.ai`.
|
|
293
330
|
*/
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
331
|
+
submitWorkflowExecutionActuals(request, requestOptions) {
|
|
332
|
+
var _a;
|
|
333
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
334
|
+
const _response = yield core.fetcher({
|
|
335
|
+
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
336
|
+
.predict, "v1/submit-workflow-execution-actuals"),
|
|
337
|
+
method: "POST",
|
|
338
|
+
headers: {
|
|
339
|
+
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
340
|
+
"X-Fern-Language": "JavaScript",
|
|
341
|
+
"X-Fern-SDK-Name": "vellum-ai",
|
|
342
|
+
"X-Fern-SDK-Version": "v0.1.1",
|
|
343
|
+
},
|
|
344
|
+
contentType: "application/json",
|
|
345
|
+
body: yield serializers.SubmitWorkflowExecutionActualsRequest.jsonOrThrow(request, {
|
|
346
|
+
unrecognizedObjectKeys: "strip",
|
|
347
|
+
}),
|
|
348
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
349
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
313
350
|
});
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
351
|
+
if (_response.ok) {
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
if (_response.error.reason === "status-code") {
|
|
317
355
|
throw new errors.VellumError({
|
|
318
356
|
statusCode: _response.error.statusCode,
|
|
319
|
-
body: _response.error.
|
|
357
|
+
body: _response.error.body,
|
|
320
358
|
});
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
359
|
+
}
|
|
360
|
+
switch (_response.error.reason) {
|
|
361
|
+
case "non-json":
|
|
362
|
+
throw new errors.VellumError({
|
|
363
|
+
statusCode: _response.error.statusCode,
|
|
364
|
+
body: _response.error.rawBody,
|
|
365
|
+
});
|
|
366
|
+
case "timeout":
|
|
367
|
+
throw new errors.VellumTimeoutError();
|
|
368
|
+
case "unknown":
|
|
369
|
+
throw new errors.VellumError({
|
|
370
|
+
message: _response.error.errorMessage,
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
});
|
|
328
374
|
}
|
|
329
|
-
_deployments;
|
|
330
375
|
get deployments() {
|
|
331
|
-
|
|
376
|
+
var _a;
|
|
377
|
+
return ((_a = this._deployments) !== null && _a !== void 0 ? _a : (this._deployments = new Client_1.Deployments(this._options)));
|
|
332
378
|
}
|
|
333
|
-
_documentIndexes;
|
|
334
379
|
get documentIndexes() {
|
|
335
|
-
|
|
380
|
+
var _a;
|
|
381
|
+
return ((_a = this._documentIndexes) !== null && _a !== void 0 ? _a : (this._documentIndexes = new Client_2.DocumentIndexes(this._options)));
|
|
336
382
|
}
|
|
337
|
-
_documents;
|
|
338
383
|
get documents() {
|
|
339
|
-
|
|
384
|
+
var _a;
|
|
385
|
+
return ((_a = this._documents) !== null && _a !== void 0 ? _a : (this._documents = new Client_3.Documents(this._options)));
|
|
340
386
|
}
|
|
341
|
-
_modelVersions;
|
|
342
387
|
get modelVersions() {
|
|
343
|
-
|
|
388
|
+
var _a;
|
|
389
|
+
return ((_a = this._modelVersions) !== null && _a !== void 0 ? _a : (this._modelVersions = new Client_4.ModelVersions(this._options)));
|
|
344
390
|
}
|
|
345
|
-
_registeredPrompts;
|
|
346
391
|
get registeredPrompts() {
|
|
347
|
-
|
|
392
|
+
var _a;
|
|
393
|
+
return ((_a = this._registeredPrompts) !== null && _a !== void 0 ? _a : (this._registeredPrompts = new Client_5.RegisteredPrompts(this._options)));
|
|
348
394
|
}
|
|
349
|
-
_sandboxes;
|
|
350
395
|
get sandboxes() {
|
|
351
|
-
|
|
396
|
+
var _a;
|
|
397
|
+
return ((_a = this._sandboxes) !== null && _a !== void 0 ? _a : (this._sandboxes = new Client_6.Sandboxes(this._options)));
|
|
352
398
|
}
|
|
353
|
-
_testSuites;
|
|
354
399
|
get testSuites() {
|
|
355
|
-
|
|
400
|
+
var _a;
|
|
401
|
+
return ((_a = this._testSuites) !== null && _a !== void 0 ? _a : (this._testSuites = new Client_7.TestSuites(this._options)));
|
|
356
402
|
}
|
|
357
403
|
}
|
|
358
404
|
exports.VellumClient = VellumClient;
|