vellum-ai 0.1.8 → 0.1.9
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 +32 -0
- package/Client.js +254 -36
- package/api/client/requests/ExecutePromptRequest.d.ts +20 -0
- package/api/client/requests/ExecutePromptRequest.js +5 -0
- package/api/client/requests/ExecutePromptStreamRequest.d.ts +20 -0
- package/api/client/requests/ExecutePromptStreamRequest.js +5 -0
- package/api/client/requests/GenerateBodyRequest.d.ts +11 -0
- package/api/client/requests/SubmitCompletionActualsRequest.d.ts +6 -0
- package/api/client/requests/SubmitWorkflowExecutionActualsRequest.d.ts +6 -0
- package/api/client/requests/index.d.ts +2 -0
- package/api/errors/ForbiddenError.d.ts +1 -2
- package/api/resources/deployments/client/Client.js +2 -2
- package/api/resources/deployments/client/requests/DeploymentProviderPayloadRequest.d.ts +6 -0
- package/api/resources/documentIndexes/client/Client.js +2 -2
- package/api/resources/documents/client/Client.d.ts +3 -0
- package/api/resources/documents/client/Client.js +7 -5
- package/api/resources/documents/client/requests/DocumentsListRequest.d.ts +4 -0
- package/api/resources/modelVersions/client/Client.js +1 -1
- package/api/resources/registeredPrompts/client/Client.js +1 -1
- package/api/resources/registeredPrompts/client/requests/RegisterPromptRequestRequest.d.ts +1 -0
- package/api/resources/sandboxes/client/Client.d.ts +3 -0
- package/api/resources/sandboxes/client/Client.js +5 -2
- package/api/resources/testSuites/client/Client.d.ts +8 -0
- package/api/resources/testSuites/client/Client.js +10 -2
- package/api/resources/testSuites/client/requests/UpsertTestSuiteTestCaseRequest.d.ts +7 -0
- package/api/types/BlockTypeEnum.d.ts +4 -4
- package/api/types/ChatMessageRole.d.ts +4 -4
- package/api/types/DeploymentRead.d.ts +6 -6
- package/api/types/DeploymentStatus.d.ts +3 -3
- package/api/types/DocumentDocumentToDocumentIndex.d.ts +5 -5
- package/api/types/DocumentIndexRead.d.ts +5 -5
- package/api/types/DocumentIndexStatus.d.ts +2 -2
- package/api/types/DocumentRead.d.ts +5 -5
- package/api/types/EnrichedNormalizedCompletion.d.ts +3 -3
- package/api/types/EnvironmentEnum.d.ts +3 -3
- package/api/types/ErrorVariableValue.d.ts +7 -0
- package/api/types/ErrorVariableValue.js +5 -0
- package/api/types/ExecutePromptApiErrorResponse.d.ts +7 -0
- package/api/types/ExecutePromptApiErrorResponse.js +5 -0
- package/api/types/ExecutePromptEvent.d.ts +19 -0
- package/api/types/ExecutePromptEvent.js +5 -0
- package/api/types/ExecutePromptResponse.d.ts +13 -0
- package/api/types/ExecutePromptResponse.js +5 -0
- package/api/types/FinishReasonEnum.d.ts +3 -3
- package/api/types/FulfilledEnum.d.ts +4 -0
- package/api/types/FulfilledEnum.js +5 -0
- package/api/types/FulfilledExecutePromptEvent.d.ts +12 -0
- package/api/types/FulfilledExecutePromptEvent.js +5 -0
- package/api/types/FulfilledExecutePromptResponse.d.ts +15 -0
- package/api/types/FulfilledExecutePromptResponse.js +5 -0
- package/api/types/FulfilledPromptExecutionMeta.d.ts +11 -0
- package/api/types/FulfilledPromptExecutionMeta.js +5 -0
- package/api/types/GenerateOptionsRequest.d.ts +2 -2
- package/api/types/IndexingStateEnum.d.ts +5 -5
- package/api/types/InitiatedEnum.d.ts +4 -0
- package/api/types/InitiatedEnum.js +5 -0
- package/api/types/InitiatedExecutePromptEvent.d.ts +11 -0
- package/api/types/InitiatedExecutePromptEvent.js +5 -0
- package/api/types/InitiatedPromptExecutionMeta.d.ts +12 -0
- package/api/types/InitiatedPromptExecutionMeta.js +5 -0
- package/api/types/JsonVariableValue.d.ts +6 -0
- package/api/types/JsonVariableValue.js +5 -0
- package/api/types/LogicalOperator.d.ts +18 -18
- package/api/types/LogprobsEnum.d.ts +2 -2
- package/api/types/MetadataFilterRuleCombinator.d.ts +2 -2
- package/api/types/ModelVersionRead.d.ts +13 -12
- package/api/types/ModelVersionReadStatusEnum.d.ts +4 -4
- package/api/types/ProcessingFailureReasonEnum.d.ts +2 -2
- package/api/types/ProcessingStateEnum.d.ts +4 -4
- package/api/types/PromptDeploymentExpandMetaRequestRequest.d.ts +15 -0
- package/api/types/PromptDeploymentExpandMetaRequestRequest.js +5 -0
- package/api/types/PromptExecutionMeta.d.ts +14 -0
- package/api/types/PromptExecutionMeta.js +5 -0
- package/api/types/PromptOutput.d.ts +16 -0
- package/api/types/PromptOutput.js +5 -0
- package/api/types/ProviderEnum.d.ts +15 -13
- package/api/types/ProviderEnum.js +1 -0
- package/api/types/RawPromptExecutionOverridesRequest.d.ts +10 -0
- package/api/types/RawPromptExecutionOverridesRequest.js +5 -0
- package/api/types/RejectedEnum.d.ts +4 -0
- package/api/types/RejectedEnum.js +5 -0
- package/api/types/RejectedExecutePromptEvent.d.ts +12 -0
- package/api/types/RejectedExecutePromptEvent.js +5 -0
- package/api/types/RejectedExecutePromptResponse.d.ts +15 -0
- package/api/types/RejectedExecutePromptResponse.js +5 -0
- package/api/types/RejectedPromptExecutionMeta.d.ts +11 -0
- package/api/types/RejectedPromptExecutionMeta.js +5 -0
- package/api/types/ScenarioInputTypeEnum.d.ts +2 -2
- package/api/types/SlimDocument.d.ts +7 -7
- package/api/types/StreamingEnum.d.ts +4 -0
- package/api/types/StreamingEnum.js +5 -0
- package/api/types/StreamingExecutePromptEvent.d.ts +15 -0
- package/api/types/StreamingExecutePromptEvent.js +5 -0
- package/api/types/StreamingPromptExecutionMeta.d.ts +9 -0
- package/api/types/StreamingPromptExecutionMeta.js +5 -0
- package/api/types/StringVariableValue.d.ts +6 -0
- package/api/types/StringVariableValue.js +5 -0
- package/api/types/VellumErrorCodeEnum.d.ts +3 -3
- package/api/types/VellumVariableType.d.ts +9 -7
- package/api/types/VellumVariableType.js +1 -0
- package/api/types/WorkflowExecutionEventErrorCode.d.ts +6 -6
- package/api/types/WorkflowExecutionEventType.d.ts +2 -2
- package/api/types/WorkflowNodeResultEventState.d.ts +4 -4
- package/api/types/WorkflowRequestInputRequest.d.ts +4 -1
- package/api/types/WorkflowRequestNumberInputRequest.d.ts +8 -0
- package/api/types/WorkflowRequestNumberInputRequest.js +5 -0
- package/api/types/index.d.ts +25 -0
- package/api/types/index.js +25 -0
- package/core/fetcher/APIResponse.d.ts +1 -0
- package/core/fetcher/Fetcher.d.ts +1 -4
- package/core/fetcher/Fetcher.js +52 -31
- package/core/fetcher/getHeader.d.ts +1 -0
- package/core/{streaming-fetcher → fetcher}/getHeader.js +2 -2
- package/core/fetcher/index.d.ts +1 -0
- package/core/fetcher/index.js +3 -1
- package/core/index.d.ts +0 -1
- package/core/index.js +0 -1
- package/core/streaming-fetcher/Stream.d.ts +3 -2
- package/core/streaming-fetcher/index.d.ts +0 -3
- package/core/streaming-fetcher/index.js +1 -5
- package/dist/Client.d.ts +32 -0
- package/dist/Client.js +254 -36
- package/dist/api/client/requests/ExecutePromptRequest.d.ts +20 -0
- package/dist/api/client/requests/ExecutePromptRequest.js +5 -0
- package/dist/api/client/requests/ExecutePromptStreamRequest.d.ts +20 -0
- package/dist/api/client/requests/ExecutePromptStreamRequest.js +5 -0
- package/dist/api/client/requests/GenerateBodyRequest.d.ts +11 -0
- package/dist/api/client/requests/SubmitCompletionActualsRequest.d.ts +6 -0
- package/dist/api/client/requests/SubmitWorkflowExecutionActualsRequest.d.ts +6 -0
- package/dist/api/client/requests/index.d.ts +2 -0
- package/dist/api/errors/ForbiddenError.d.ts +1 -2
- package/dist/api/resources/deployments/client/Client.js +2 -2
- package/dist/api/resources/deployments/client/requests/DeploymentProviderPayloadRequest.d.ts +6 -0
- package/dist/api/resources/documentIndexes/client/Client.js +2 -2
- package/dist/api/resources/documents/client/Client.d.ts +3 -0
- package/dist/api/resources/documents/client/Client.js +7 -5
- package/dist/api/resources/documents/client/requests/DocumentsListRequest.d.ts +4 -0
- package/dist/api/resources/modelVersions/client/Client.js +1 -1
- package/dist/api/resources/registeredPrompts/client/Client.js +1 -1
- package/dist/api/resources/registeredPrompts/client/requests/RegisterPromptRequestRequest.d.ts +1 -0
- package/dist/api/resources/sandboxes/client/Client.d.ts +3 -0
- package/dist/api/resources/sandboxes/client/Client.js +5 -2
- package/dist/api/resources/testSuites/client/Client.d.ts +8 -0
- package/dist/api/resources/testSuites/client/Client.js +10 -2
- package/dist/api/resources/testSuites/client/requests/UpsertTestSuiteTestCaseRequest.d.ts +7 -0
- package/dist/api/types/BlockTypeEnum.d.ts +4 -4
- package/dist/api/types/ChatMessageRole.d.ts +4 -4
- package/dist/api/types/DeploymentRead.d.ts +6 -6
- package/dist/api/types/DeploymentStatus.d.ts +3 -3
- package/dist/api/types/DocumentDocumentToDocumentIndex.d.ts +5 -5
- package/dist/api/types/DocumentIndexRead.d.ts +5 -5
- package/dist/api/types/DocumentIndexStatus.d.ts +2 -2
- package/dist/api/types/DocumentRead.d.ts +5 -5
- package/dist/api/types/EnrichedNormalizedCompletion.d.ts +3 -3
- package/dist/api/types/EnvironmentEnum.d.ts +3 -3
- package/dist/api/types/ErrorVariableValue.d.ts +7 -0
- package/dist/api/types/ErrorVariableValue.js +5 -0
- package/dist/api/types/ExecutePromptApiErrorResponse.d.ts +7 -0
- package/dist/api/types/ExecutePromptApiErrorResponse.js +5 -0
- package/dist/api/types/ExecutePromptEvent.d.ts +19 -0
- package/dist/api/types/ExecutePromptEvent.js +5 -0
- package/dist/api/types/ExecutePromptResponse.d.ts +13 -0
- package/dist/api/types/ExecutePromptResponse.js +5 -0
- package/dist/api/types/FinishReasonEnum.d.ts +3 -3
- package/dist/api/types/FulfilledEnum.d.ts +4 -0
- package/dist/api/types/FulfilledEnum.js +5 -0
- package/dist/api/types/FulfilledExecutePromptEvent.d.ts +12 -0
- package/dist/api/types/FulfilledExecutePromptEvent.js +5 -0
- package/dist/api/types/FulfilledExecutePromptResponse.d.ts +15 -0
- package/dist/api/types/FulfilledExecutePromptResponse.js +5 -0
- package/dist/api/types/FulfilledPromptExecutionMeta.d.ts +11 -0
- package/dist/api/types/FulfilledPromptExecutionMeta.js +5 -0
- package/dist/api/types/GenerateOptionsRequest.d.ts +2 -2
- package/dist/api/types/IndexingStateEnum.d.ts +5 -5
- package/dist/api/types/InitiatedEnum.d.ts +4 -0
- package/dist/api/types/InitiatedEnum.js +5 -0
- package/dist/api/types/InitiatedExecutePromptEvent.d.ts +11 -0
- package/dist/api/types/InitiatedExecutePromptEvent.js +5 -0
- package/dist/api/types/InitiatedPromptExecutionMeta.d.ts +12 -0
- package/dist/api/types/InitiatedPromptExecutionMeta.js +5 -0
- package/dist/api/types/JsonVariableValue.d.ts +6 -0
- package/dist/api/types/JsonVariableValue.js +5 -0
- package/dist/api/types/LogicalOperator.d.ts +18 -18
- package/dist/api/types/LogprobsEnum.d.ts +2 -2
- package/dist/api/types/MetadataFilterRuleCombinator.d.ts +2 -2
- package/dist/api/types/ModelVersionRead.d.ts +13 -12
- package/dist/api/types/ModelVersionReadStatusEnum.d.ts +4 -4
- package/dist/api/types/ProcessingFailureReasonEnum.d.ts +2 -2
- package/dist/api/types/ProcessingStateEnum.d.ts +4 -4
- package/dist/api/types/PromptDeploymentExpandMetaRequestRequest.d.ts +15 -0
- package/dist/api/types/PromptDeploymentExpandMetaRequestRequest.js +5 -0
- package/dist/api/types/PromptExecutionMeta.d.ts +14 -0
- package/dist/api/types/PromptExecutionMeta.js +5 -0
- package/dist/api/types/PromptOutput.d.ts +16 -0
- package/dist/api/types/PromptOutput.js +5 -0
- package/dist/api/types/ProviderEnum.d.ts +15 -13
- package/dist/api/types/ProviderEnum.js +1 -0
- package/dist/api/types/RawPromptExecutionOverridesRequest.d.ts +10 -0
- package/dist/api/types/RawPromptExecutionOverridesRequest.js +5 -0
- package/dist/api/types/RejectedEnum.d.ts +4 -0
- package/dist/api/types/RejectedEnum.js +5 -0
- package/dist/api/types/RejectedExecutePromptEvent.d.ts +12 -0
- package/dist/api/types/RejectedExecutePromptEvent.js +5 -0
- package/dist/api/types/RejectedExecutePromptResponse.d.ts +15 -0
- package/dist/api/types/RejectedExecutePromptResponse.js +5 -0
- package/dist/api/types/RejectedPromptExecutionMeta.d.ts +11 -0
- package/dist/api/types/RejectedPromptExecutionMeta.js +5 -0
- package/dist/api/types/ScenarioInputTypeEnum.d.ts +2 -2
- package/dist/api/types/SlimDocument.d.ts +7 -7
- package/dist/api/types/StreamingEnum.d.ts +4 -0
- package/dist/api/types/StreamingEnum.js +5 -0
- package/dist/api/types/StreamingExecutePromptEvent.d.ts +15 -0
- package/dist/api/types/StreamingExecutePromptEvent.js +5 -0
- package/dist/api/types/StreamingPromptExecutionMeta.d.ts +9 -0
- package/dist/api/types/StreamingPromptExecutionMeta.js +5 -0
- package/dist/api/types/StringVariableValue.d.ts +6 -0
- package/dist/api/types/StringVariableValue.js +5 -0
- package/dist/api/types/VellumErrorCodeEnum.d.ts +3 -3
- package/dist/api/types/VellumVariableType.d.ts +9 -7
- package/dist/api/types/VellumVariableType.js +1 -0
- package/dist/api/types/WorkflowExecutionEventErrorCode.d.ts +6 -6
- package/dist/api/types/WorkflowExecutionEventType.d.ts +2 -2
- package/dist/api/types/WorkflowNodeResultEventState.d.ts +4 -4
- package/dist/api/types/WorkflowRequestInputRequest.d.ts +4 -1
- package/dist/api/types/WorkflowRequestNumberInputRequest.d.ts +8 -0
- package/dist/api/types/WorkflowRequestNumberInputRequest.js +5 -0
- package/dist/api/types/index.d.ts +25 -0
- package/dist/api/types/index.js +25 -0
- package/dist/core/fetcher/APIResponse.d.ts +1 -0
- package/dist/core/fetcher/Fetcher.d.ts +1 -4
- package/dist/core/fetcher/Fetcher.js +52 -31
- package/dist/core/fetcher/getHeader.d.ts +1 -0
- package/dist/core/{streaming-fetcher → fetcher}/getHeader.js +2 -2
- package/dist/core/fetcher/index.d.ts +1 -0
- package/dist/core/fetcher/index.js +3 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.js +0 -1
- package/dist/core/streaming-fetcher/Stream.d.ts +3 -2
- package/dist/core/streaming-fetcher/index.d.ts +0 -3
- package/dist/core/streaming-fetcher/index.js +1 -5
- package/dist/serialization/client/requests/ExecutePromptRequest.d.ts +20 -0
- package/dist/serialization/client/requests/ExecutePromptRequest.js +52 -0
- package/dist/serialization/client/requests/ExecutePromptStreamRequest.d.ts +20 -0
- package/dist/serialization/client/requests/ExecutePromptStreamRequest.js +52 -0
- package/dist/serialization/client/requests/index.d.ts +2 -0
- package/dist/serialization/client/requests/index.js +5 -1
- package/dist/serialization/types/ErrorVariableValue.d.ts +12 -0
- package/dist/serialization/types/ErrorVariableValue.js +42 -0
- package/dist/serialization/types/ExecutePromptApiErrorResponse.d.ts +12 -0
- package/dist/serialization/types/ExecutePromptApiErrorResponse.js +33 -0
- package/dist/serialization/types/ExecutePromptEvent.d.ts +22 -0
- package/dist/serialization/types/ExecutePromptEvent.js +50 -0
- package/dist/serialization/types/ExecutePromptResponse.d.ts +16 -0
- package/dist/serialization/types/ExecutePromptResponse.js +48 -0
- package/dist/serialization/types/FulfilledEnum.d.ts +10 -0
- package/dist/serialization/types/FulfilledEnum.js +31 -0
- package/dist/serialization/types/FulfilledExecutePromptEvent.d.ts +14 -0
- package/dist/serialization/types/FulfilledExecutePromptEvent.js +44 -0
- package/dist/serialization/types/FulfilledExecutePromptResponse.d.ts +15 -0
- package/dist/serialization/types/FulfilledExecutePromptResponse.js +45 -0
- package/dist/serialization/types/FulfilledPromptExecutionMeta.d.ts +13 -0
- package/dist/serialization/types/FulfilledPromptExecutionMeta.js +43 -0
- package/dist/serialization/types/InitiatedEnum.d.ts +10 -0
- package/dist/serialization/types/InitiatedEnum.js +31 -0
- package/dist/serialization/types/InitiatedExecutePromptEvent.d.ts +13 -0
- package/dist/serialization/types/InitiatedExecutePromptEvent.js +43 -0
- package/dist/serialization/types/InitiatedPromptExecutionMeta.d.ts +15 -0
- package/dist/serialization/types/InitiatedPromptExecutionMeta.js +36 -0
- package/dist/serialization/types/JsonVariableValue.d.ts +12 -0
- package/dist/serialization/types/JsonVariableValue.js +33 -0
- package/dist/serialization/types/PromptDeploymentExpandMetaRequestRequest.d.ts +16 -0
- package/dist/serialization/types/PromptDeploymentExpandMetaRequestRequest.js +37 -0
- package/dist/serialization/types/PromptExecutionMeta.d.ts +16 -0
- package/dist/serialization/types/PromptExecutionMeta.js +46 -0
- package/dist/serialization/types/PromptOutput.d.ts +19 -0
- package/dist/serialization/types/PromptOutput.js +49 -0
- package/dist/serialization/types/ProviderEnum.d.ts +1 -1
- package/dist/serialization/types/ProviderEnum.js +1 -0
- package/dist/serialization/types/RawPromptExecutionOverridesRequest.d.ts +14 -0
- package/dist/serialization/types/RawPromptExecutionOverridesRequest.js +35 -0
- package/dist/serialization/types/RejectedEnum.d.ts +10 -0
- package/dist/serialization/types/RejectedEnum.js +31 -0
- package/dist/serialization/types/RejectedExecutePromptEvent.d.ts +14 -0
- package/dist/serialization/types/RejectedExecutePromptEvent.js +44 -0
- package/dist/serialization/types/RejectedExecutePromptResponse.d.ts +15 -0
- package/dist/serialization/types/RejectedExecutePromptResponse.js +45 -0
- package/dist/serialization/types/RejectedPromptExecutionMeta.d.ts +13 -0
- package/dist/serialization/types/RejectedPromptExecutionMeta.js +43 -0
- package/dist/serialization/types/StreamingEnum.d.ts +10 -0
- package/dist/serialization/types/StreamingEnum.js +31 -0
- package/dist/serialization/types/StreamingExecutePromptEvent.d.ts +16 -0
- package/dist/serialization/types/StreamingExecutePromptEvent.js +46 -0
- package/dist/serialization/types/StreamingPromptExecutionMeta.d.ts +12 -0
- package/dist/serialization/types/StreamingPromptExecutionMeta.js +33 -0
- package/dist/serialization/types/StringVariableValue.d.ts +12 -0
- package/dist/serialization/types/StringVariableValue.js +33 -0
- package/dist/serialization/types/VellumVariableType.d.ts +1 -1
- package/dist/serialization/types/VellumVariableType.js +1 -1
- package/dist/serialization/types/WorkflowRequestInputRequest.d.ts +4 -1
- package/dist/serialization/types/WorkflowRequestInputRequest.js +1 -0
- package/dist/serialization/types/WorkflowRequestNumberInputRequest.d.ts +13 -0
- package/dist/serialization/types/WorkflowRequestNumberInputRequest.js +34 -0
- package/dist/serialization/types/index.d.ts +25 -0
- package/dist/serialization/types/index.js +25 -0
- package/package.json +6 -5
- package/serialization/client/requests/ExecutePromptRequest.d.ts +20 -0
- package/serialization/client/requests/ExecutePromptRequest.js +52 -0
- package/serialization/client/requests/ExecutePromptStreamRequest.d.ts +20 -0
- package/serialization/client/requests/ExecutePromptStreamRequest.js +52 -0
- package/serialization/client/requests/index.d.ts +2 -0
- package/serialization/client/requests/index.js +5 -1
- package/serialization/types/ErrorVariableValue.d.ts +12 -0
- package/serialization/types/ErrorVariableValue.js +42 -0
- package/serialization/types/ExecutePromptApiErrorResponse.d.ts +12 -0
- package/serialization/types/ExecutePromptApiErrorResponse.js +33 -0
- package/serialization/types/ExecutePromptEvent.d.ts +22 -0
- package/serialization/types/ExecutePromptEvent.js +50 -0
- package/serialization/types/ExecutePromptResponse.d.ts +16 -0
- package/serialization/types/ExecutePromptResponse.js +48 -0
- package/serialization/types/FulfilledEnum.d.ts +10 -0
- package/serialization/types/FulfilledEnum.js +31 -0
- package/serialization/types/FulfilledExecutePromptEvent.d.ts +14 -0
- package/serialization/types/FulfilledExecutePromptEvent.js +44 -0
- package/serialization/types/FulfilledExecutePromptResponse.d.ts +15 -0
- package/serialization/types/FulfilledExecutePromptResponse.js +45 -0
- package/serialization/types/FulfilledPromptExecutionMeta.d.ts +13 -0
- package/serialization/types/FulfilledPromptExecutionMeta.js +43 -0
- package/serialization/types/InitiatedEnum.d.ts +10 -0
- package/serialization/types/InitiatedEnum.js +31 -0
- package/serialization/types/InitiatedExecutePromptEvent.d.ts +13 -0
- package/serialization/types/InitiatedExecutePromptEvent.js +43 -0
- package/serialization/types/InitiatedPromptExecutionMeta.d.ts +15 -0
- package/serialization/types/InitiatedPromptExecutionMeta.js +36 -0
- package/serialization/types/JsonVariableValue.d.ts +12 -0
- package/serialization/types/JsonVariableValue.js +33 -0
- package/serialization/types/PromptDeploymentExpandMetaRequestRequest.d.ts +16 -0
- package/serialization/types/PromptDeploymentExpandMetaRequestRequest.js +37 -0
- package/serialization/types/PromptExecutionMeta.d.ts +16 -0
- package/serialization/types/PromptExecutionMeta.js +46 -0
- package/serialization/types/PromptOutput.d.ts +19 -0
- package/serialization/types/PromptOutput.js +49 -0
- package/serialization/types/ProviderEnum.d.ts +1 -1
- package/serialization/types/ProviderEnum.js +1 -0
- package/serialization/types/RawPromptExecutionOverridesRequest.d.ts +14 -0
- package/serialization/types/RawPromptExecutionOverridesRequest.js +35 -0
- package/serialization/types/RejectedEnum.d.ts +10 -0
- package/serialization/types/RejectedEnum.js +31 -0
- package/serialization/types/RejectedExecutePromptEvent.d.ts +14 -0
- package/serialization/types/RejectedExecutePromptEvent.js +44 -0
- package/serialization/types/RejectedExecutePromptResponse.d.ts +15 -0
- package/serialization/types/RejectedExecutePromptResponse.js +45 -0
- package/serialization/types/RejectedPromptExecutionMeta.d.ts +13 -0
- package/serialization/types/RejectedPromptExecutionMeta.js +43 -0
- package/serialization/types/StreamingEnum.d.ts +10 -0
- package/serialization/types/StreamingEnum.js +31 -0
- package/serialization/types/StreamingExecutePromptEvent.d.ts +16 -0
- package/serialization/types/StreamingExecutePromptEvent.js +46 -0
- package/serialization/types/StreamingPromptExecutionMeta.d.ts +12 -0
- package/serialization/types/StreamingPromptExecutionMeta.js +33 -0
- package/serialization/types/StringVariableValue.d.ts +12 -0
- package/serialization/types/StringVariableValue.js +33 -0
- package/serialization/types/VellumVariableType.d.ts +1 -1
- package/serialization/types/VellumVariableType.js +1 -1
- package/serialization/types/WorkflowRequestInputRequest.d.ts +4 -1
- package/serialization/types/WorkflowRequestInputRequest.js +1 -0
- package/serialization/types/WorkflowRequestNumberInputRequest.d.ts +13 -0
- package/serialization/types/WorkflowRequestNumberInputRequest.js +34 -0
- package/serialization/types/index.d.ts +25 -0
- package/serialization/types/index.js +25 -0
- package/core/form-data-utils/getFormDataContentLength.d.ts +0 -2
- package/core/form-data-utils/getFormDataContentLength.js +0 -27
- package/core/form-data-utils/index.d.ts +0 -1
- package/core/form-data-utils/index.js +0 -5
- package/core/streaming-fetcher/StreamingFetcher.d.ts +0 -24
- package/core/streaming-fetcher/StreamingFetcher.js +0 -58
- package/core/streaming-fetcher/getHeader.d.ts +0 -2
- package/dist/core/form-data-utils/getFormDataContentLength.d.ts +0 -2
- package/dist/core/form-data-utils/getFormDataContentLength.js +0 -27
- package/dist/core/form-data-utils/index.d.ts +0 -1
- package/dist/core/form-data-utils/index.js +0 -5
- package/dist/core/streaming-fetcher/StreamingFetcher.d.ts +0 -24
- package/dist/core/streaming-fetcher/StreamingFetcher.js +0 -58
- package/dist/core/streaming-fetcher/getHeader.d.ts +0 -2
package/api/types/index.d.ts
CHANGED
|
@@ -26,10 +26,18 @@ export * from "./DocumentRead";
|
|
|
26
26
|
export * from "./DocumentStatus";
|
|
27
27
|
export * from "./EnrichedNormalizedCompletion";
|
|
28
28
|
export * from "./EnvironmentEnum";
|
|
29
|
+
export * from "./ErrorVariableValue";
|
|
29
30
|
export * from "./EvaluationParams";
|
|
30
31
|
export * from "./EvaluationParamsRequest";
|
|
32
|
+
export * from "./ExecutePromptApiErrorResponse";
|
|
33
|
+
export * from "./ExecutePromptEvent";
|
|
34
|
+
export * from "./ExecutePromptResponse";
|
|
31
35
|
export * from "./ExecuteWorkflowStreamErrorResponse";
|
|
32
36
|
export * from "./FinishReasonEnum";
|
|
37
|
+
export * from "./FulfilledEnum";
|
|
38
|
+
export * from "./FulfilledExecutePromptEvent";
|
|
39
|
+
export * from "./FulfilledExecutePromptResponse";
|
|
40
|
+
export * from "./FulfilledPromptExecutionMeta";
|
|
33
41
|
export * from "./GenerateErrorResponse";
|
|
34
42
|
export * from "./GenerateOptionsRequest";
|
|
35
43
|
export * from "./GenerateRequest";
|
|
@@ -41,7 +49,11 @@ export * from "./GenerateStreamResponse";
|
|
|
41
49
|
export * from "./GenerateStreamResult";
|
|
42
50
|
export * from "./GenerateStreamResultData";
|
|
43
51
|
export * from "./IndexingStateEnum";
|
|
52
|
+
export * from "./InitiatedEnum";
|
|
53
|
+
export * from "./InitiatedExecutePromptEvent";
|
|
54
|
+
export * from "./InitiatedPromptExecutionMeta";
|
|
44
55
|
export * from "./JsonInputRequest";
|
|
56
|
+
export * from "./JsonVariableValue";
|
|
45
57
|
export * from "./LogicalOperator";
|
|
46
58
|
export * from "./LogprobsEnum";
|
|
47
59
|
export * from "./MetadataFilterConfigRequest";
|
|
@@ -72,9 +84,12 @@ export * from "./NormalizedTokenLogProbs";
|
|
|
72
84
|
export * from "./PaginatedSlimDocumentList";
|
|
73
85
|
export * from "./ProcessingFailureReasonEnum";
|
|
74
86
|
export * from "./ProcessingStateEnum";
|
|
87
|
+
export * from "./PromptDeploymentExpandMetaRequestRequest";
|
|
75
88
|
export * from "./PromptDeploymentInputRequest";
|
|
89
|
+
export * from "./PromptExecutionMeta";
|
|
76
90
|
export * from "./PromptNodeResult";
|
|
77
91
|
export * from "./PromptNodeResultData";
|
|
92
|
+
export * from "./PromptOutput";
|
|
78
93
|
export * from "./PromptTemplateBlock";
|
|
79
94
|
export * from "./PromptTemplateBlockData";
|
|
80
95
|
export * from "./PromptTemplateBlockDataRequest";
|
|
@@ -82,6 +97,7 @@ export * from "./PromptTemplateBlockProperties";
|
|
|
82
97
|
export * from "./PromptTemplateBlockPropertiesRequest";
|
|
83
98
|
export * from "./PromptTemplateBlockRequest";
|
|
84
99
|
export * from "./ProviderEnum";
|
|
100
|
+
export * from "./RawPromptExecutionOverridesRequest";
|
|
85
101
|
export * from "./RegisterPromptErrorResponse";
|
|
86
102
|
export * from "./RegisterPromptModelParametersRequest";
|
|
87
103
|
export * from "./RegisterPromptPrompt";
|
|
@@ -92,6 +108,10 @@ export * from "./RegisteredPromptInputVariableRequest";
|
|
|
92
108
|
export * from "./RegisteredPromptModelVersion";
|
|
93
109
|
export * from "./RegisteredPromptSandbox";
|
|
94
110
|
export * from "./RegisteredPromptSandboxSnapshot";
|
|
111
|
+
export * from "./RejectedEnum";
|
|
112
|
+
export * from "./RejectedExecutePromptEvent";
|
|
113
|
+
export * from "./RejectedExecutePromptResponse";
|
|
114
|
+
export * from "./RejectedPromptExecutionMeta";
|
|
95
115
|
export * from "./SandboxMetricInputParams";
|
|
96
116
|
export * from "./SandboxMetricInputParamsRequest";
|
|
97
117
|
export * from "./SandboxScenario";
|
|
@@ -111,7 +131,11 @@ export * from "./SearchResultMergingRequest";
|
|
|
111
131
|
export * from "./SearchResultRequest";
|
|
112
132
|
export * from "./SearchWeightsRequest";
|
|
113
133
|
export * from "./SlimDocument";
|
|
134
|
+
export * from "./StreamingEnum";
|
|
135
|
+
export * from "./StreamingExecutePromptEvent";
|
|
136
|
+
export * from "./StreamingPromptExecutionMeta";
|
|
114
137
|
export * from "./StringInputRequest";
|
|
138
|
+
export * from "./StringVariableValue";
|
|
115
139
|
export * from "./SubmitCompletionActualRequest";
|
|
116
140
|
export * from "./SubmitCompletionActualsErrorResponse";
|
|
117
141
|
export * from "./SubmitWorkflowExecutionActualRequest";
|
|
@@ -162,6 +186,7 @@ export * from "./WorkflowNodeResultEventState";
|
|
|
162
186
|
export * from "./WorkflowRequestChatHistoryInputRequest";
|
|
163
187
|
export * from "./WorkflowRequestInputRequest";
|
|
164
188
|
export * from "./WorkflowRequestJsonInputRequest";
|
|
189
|
+
export * from "./WorkflowRequestNumberInputRequest";
|
|
165
190
|
export * from "./WorkflowRequestStringInputRequest";
|
|
166
191
|
export * from "./WorkflowResultEvent";
|
|
167
192
|
export * from "./WorkflowResultEventOutputData";
|
package/api/types/index.js
CHANGED
|
@@ -42,10 +42,18 @@ __exportStar(require("./DocumentRead"), exports);
|
|
|
42
42
|
__exportStar(require("./DocumentStatus"), exports);
|
|
43
43
|
__exportStar(require("./EnrichedNormalizedCompletion"), exports);
|
|
44
44
|
__exportStar(require("./EnvironmentEnum"), exports);
|
|
45
|
+
__exportStar(require("./ErrorVariableValue"), exports);
|
|
45
46
|
__exportStar(require("./EvaluationParams"), exports);
|
|
46
47
|
__exportStar(require("./EvaluationParamsRequest"), exports);
|
|
48
|
+
__exportStar(require("./ExecutePromptApiErrorResponse"), exports);
|
|
49
|
+
__exportStar(require("./ExecutePromptEvent"), exports);
|
|
50
|
+
__exportStar(require("./ExecutePromptResponse"), exports);
|
|
47
51
|
__exportStar(require("./ExecuteWorkflowStreamErrorResponse"), exports);
|
|
48
52
|
__exportStar(require("./FinishReasonEnum"), exports);
|
|
53
|
+
__exportStar(require("./FulfilledEnum"), exports);
|
|
54
|
+
__exportStar(require("./FulfilledExecutePromptEvent"), exports);
|
|
55
|
+
__exportStar(require("./FulfilledExecutePromptResponse"), exports);
|
|
56
|
+
__exportStar(require("./FulfilledPromptExecutionMeta"), exports);
|
|
49
57
|
__exportStar(require("./GenerateErrorResponse"), exports);
|
|
50
58
|
__exportStar(require("./GenerateOptionsRequest"), exports);
|
|
51
59
|
__exportStar(require("./GenerateRequest"), exports);
|
|
@@ -57,7 +65,11 @@ __exportStar(require("./GenerateStreamResponse"), exports);
|
|
|
57
65
|
__exportStar(require("./GenerateStreamResult"), exports);
|
|
58
66
|
__exportStar(require("./GenerateStreamResultData"), exports);
|
|
59
67
|
__exportStar(require("./IndexingStateEnum"), exports);
|
|
68
|
+
__exportStar(require("./InitiatedEnum"), exports);
|
|
69
|
+
__exportStar(require("./InitiatedExecutePromptEvent"), exports);
|
|
70
|
+
__exportStar(require("./InitiatedPromptExecutionMeta"), exports);
|
|
60
71
|
__exportStar(require("./JsonInputRequest"), exports);
|
|
72
|
+
__exportStar(require("./JsonVariableValue"), exports);
|
|
61
73
|
__exportStar(require("./LogicalOperator"), exports);
|
|
62
74
|
__exportStar(require("./LogprobsEnum"), exports);
|
|
63
75
|
__exportStar(require("./MetadataFilterConfigRequest"), exports);
|
|
@@ -88,9 +100,12 @@ __exportStar(require("./NormalizedTokenLogProbs"), exports);
|
|
|
88
100
|
__exportStar(require("./PaginatedSlimDocumentList"), exports);
|
|
89
101
|
__exportStar(require("./ProcessingFailureReasonEnum"), exports);
|
|
90
102
|
__exportStar(require("./ProcessingStateEnum"), exports);
|
|
103
|
+
__exportStar(require("./PromptDeploymentExpandMetaRequestRequest"), exports);
|
|
91
104
|
__exportStar(require("./PromptDeploymentInputRequest"), exports);
|
|
105
|
+
__exportStar(require("./PromptExecutionMeta"), exports);
|
|
92
106
|
__exportStar(require("./PromptNodeResult"), exports);
|
|
93
107
|
__exportStar(require("./PromptNodeResultData"), exports);
|
|
108
|
+
__exportStar(require("./PromptOutput"), exports);
|
|
94
109
|
__exportStar(require("./PromptTemplateBlock"), exports);
|
|
95
110
|
__exportStar(require("./PromptTemplateBlockData"), exports);
|
|
96
111
|
__exportStar(require("./PromptTemplateBlockDataRequest"), exports);
|
|
@@ -98,6 +113,7 @@ __exportStar(require("./PromptTemplateBlockProperties"), exports);
|
|
|
98
113
|
__exportStar(require("./PromptTemplateBlockPropertiesRequest"), exports);
|
|
99
114
|
__exportStar(require("./PromptTemplateBlockRequest"), exports);
|
|
100
115
|
__exportStar(require("./ProviderEnum"), exports);
|
|
116
|
+
__exportStar(require("./RawPromptExecutionOverridesRequest"), exports);
|
|
101
117
|
__exportStar(require("./RegisterPromptErrorResponse"), exports);
|
|
102
118
|
__exportStar(require("./RegisterPromptModelParametersRequest"), exports);
|
|
103
119
|
__exportStar(require("./RegisterPromptPrompt"), exports);
|
|
@@ -108,6 +124,10 @@ __exportStar(require("./RegisteredPromptInputVariableRequest"), exports);
|
|
|
108
124
|
__exportStar(require("./RegisteredPromptModelVersion"), exports);
|
|
109
125
|
__exportStar(require("./RegisteredPromptSandbox"), exports);
|
|
110
126
|
__exportStar(require("./RegisteredPromptSandboxSnapshot"), exports);
|
|
127
|
+
__exportStar(require("./RejectedEnum"), exports);
|
|
128
|
+
__exportStar(require("./RejectedExecutePromptEvent"), exports);
|
|
129
|
+
__exportStar(require("./RejectedExecutePromptResponse"), exports);
|
|
130
|
+
__exportStar(require("./RejectedPromptExecutionMeta"), exports);
|
|
111
131
|
__exportStar(require("./SandboxMetricInputParams"), exports);
|
|
112
132
|
__exportStar(require("./SandboxMetricInputParamsRequest"), exports);
|
|
113
133
|
__exportStar(require("./SandboxScenario"), exports);
|
|
@@ -127,7 +147,11 @@ __exportStar(require("./SearchResultMergingRequest"), exports);
|
|
|
127
147
|
__exportStar(require("./SearchResultRequest"), exports);
|
|
128
148
|
__exportStar(require("./SearchWeightsRequest"), exports);
|
|
129
149
|
__exportStar(require("./SlimDocument"), exports);
|
|
150
|
+
__exportStar(require("./StreamingEnum"), exports);
|
|
151
|
+
__exportStar(require("./StreamingExecutePromptEvent"), exports);
|
|
152
|
+
__exportStar(require("./StreamingPromptExecutionMeta"), exports);
|
|
130
153
|
__exportStar(require("./StringInputRequest"), exports);
|
|
154
|
+
__exportStar(require("./StringVariableValue"), exports);
|
|
131
155
|
__exportStar(require("./SubmitCompletionActualRequest"), exports);
|
|
132
156
|
__exportStar(require("./SubmitCompletionActualsErrorResponse"), exports);
|
|
133
157
|
__exportStar(require("./SubmitWorkflowExecutionActualRequest"), exports);
|
|
@@ -178,6 +202,7 @@ __exportStar(require("./WorkflowNodeResultEventState"), exports);
|
|
|
178
202
|
__exportStar(require("./WorkflowRequestChatHistoryInputRequest"), exports);
|
|
179
203
|
__exportStar(require("./WorkflowRequestInputRequest"), exports);
|
|
180
204
|
__exportStar(require("./WorkflowRequestJsonInputRequest"), exports);
|
|
205
|
+
__exportStar(require("./WorkflowRequestNumberInputRequest"), exports);
|
|
181
206
|
__exportStar(require("./WorkflowRequestStringInputRequest"), exports);
|
|
182
207
|
__exportStar(require("./WorkflowResultEvent"), exports);
|
|
183
208
|
__exportStar(require("./WorkflowResultEventOutputData"), exports);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AxiosAdapter } from "axios";
|
|
2
1
|
import { APIResponse } from "./APIResponse";
|
|
3
2
|
export declare type FetchFunction = <R = unknown>(args: Fetcher.Args) => Promise<APIResponse<R, Fetcher.Error>>;
|
|
4
3
|
export declare namespace Fetcher {
|
|
@@ -12,9 +11,7 @@ export declare namespace Fetcher {
|
|
|
12
11
|
timeoutMs?: number;
|
|
13
12
|
maxRetries?: number;
|
|
14
13
|
withCredentials?: boolean;
|
|
15
|
-
responseType?: "json" | "blob";
|
|
16
|
-
adapter?: AxiosAdapter;
|
|
17
|
-
onUploadProgress?: (event: ProgressEvent) => void;
|
|
14
|
+
responseType?: "json" | "blob" | "streaming";
|
|
18
15
|
}
|
|
19
16
|
type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
|
|
20
17
|
interface FailedStatusCodeError {
|
package/core/fetcher/Fetcher.js
CHANGED
|
@@ -13,8 +13,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.fetcher = void 0;
|
|
16
|
-
const
|
|
16
|
+
const form_data_1 = __importDefault(require("form-data"));
|
|
17
17
|
const qs_1 = __importDefault(require("qs"));
|
|
18
|
+
if (typeof window === "undefined") {
|
|
19
|
+
global.fetch = require("node-fetch");
|
|
20
|
+
}
|
|
18
21
|
const INITIAL_RETRY_DELAY = 1;
|
|
19
22
|
const MAX_RETRY_DELAY = 60;
|
|
20
23
|
const DEFAULT_MAX_RETRIES = 2;
|
|
@@ -32,60 +35,68 @@ function fetcherImpl(args) {
|
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
37
|
}
|
|
38
|
+
const url = Object.keys((_a = args.queryParameters) !== null && _a !== void 0 ? _a : {}).length > 0
|
|
39
|
+
? `${args.url}?${qs_1.default.stringify(args.queryParameters, { arrayFormat: "repeat" })}`
|
|
40
|
+
: args.url;
|
|
41
|
+
let body = undefined;
|
|
42
|
+
if (args.body instanceof form_data_1.default) {
|
|
43
|
+
// @ts-expect-error
|
|
44
|
+
body = args.body;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
body = JSON.stringify(args.body);
|
|
48
|
+
}
|
|
35
49
|
const makeRequest = () => __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
50
|
+
const controller = new AbortController();
|
|
51
|
+
let abortId = undefined;
|
|
52
|
+
if (args.timeoutMs != null) {
|
|
53
|
+
abortId = setTimeout(() => controller.abort(), args.timeoutMs);
|
|
54
|
+
}
|
|
55
|
+
const response = yield fetch(url, {
|
|
43
56
|
method: args.method,
|
|
44
57
|
headers,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
timeout: args.timeoutMs,
|
|
49
|
-
transitional: {
|
|
50
|
-
clarifyTimeoutError: true,
|
|
51
|
-
},
|
|
52
|
-
withCredentials: args.withCredentials,
|
|
53
|
-
adapter: args.adapter,
|
|
54
|
-
onUploadProgress: args.onUploadProgress,
|
|
55
|
-
maxBodyLength: Infinity,
|
|
56
|
-
maxContentLength: Infinity,
|
|
57
|
-
responseType: (_d = args.responseType) !== null && _d !== void 0 ? _d : "json",
|
|
58
|
+
body,
|
|
59
|
+
signal: controller.signal,
|
|
60
|
+
credentials: args.withCredentials ? "same-origin" : undefined,
|
|
58
61
|
});
|
|
62
|
+
if (abortId != null) {
|
|
63
|
+
clearTimeout(abortId);
|
|
64
|
+
}
|
|
65
|
+
return response;
|
|
59
66
|
});
|
|
60
67
|
try {
|
|
61
68
|
let response = yield makeRequest();
|
|
62
|
-
for (let i = 0; i < ((
|
|
69
|
+
for (let i = 0; i < ((_b = args.maxRetries) !== null && _b !== void 0 ? _b : DEFAULT_MAX_RETRIES); ++i) {
|
|
63
70
|
if (response.status === 408 ||
|
|
64
71
|
response.status === 409 ||
|
|
65
72
|
response.status === 429 ||
|
|
66
73
|
response.status >= 500) {
|
|
67
74
|
const delay = Math.min(INITIAL_RETRY_DELAY * Math.pow(i, 2), MAX_RETRY_DELAY);
|
|
68
|
-
|
|
75
|
+
yield new Promise((resolve) => setTimeout(resolve, delay));
|
|
76
|
+
response = yield makeRequest();
|
|
69
77
|
}
|
|
70
78
|
else {
|
|
71
79
|
break;
|
|
72
80
|
}
|
|
73
81
|
}
|
|
74
82
|
let body;
|
|
75
|
-
if (args.responseType === "blob") {
|
|
76
|
-
body = response.
|
|
83
|
+
if (response.body != null && args.responseType === "blob") {
|
|
84
|
+
body = yield response.blob();
|
|
77
85
|
}
|
|
78
|
-
else if (response.
|
|
86
|
+
else if (response.body != null && args.responseType === "streaming") {
|
|
87
|
+
body = response.body;
|
|
88
|
+
}
|
|
89
|
+
else if (response.body != null) {
|
|
79
90
|
try {
|
|
80
|
-
body =
|
|
91
|
+
body = yield response.json();
|
|
81
92
|
}
|
|
82
|
-
catch (
|
|
93
|
+
catch (err) {
|
|
83
94
|
return {
|
|
84
95
|
ok: false,
|
|
85
96
|
error: {
|
|
86
97
|
reason: "non-json",
|
|
87
98
|
statusCode: response.status,
|
|
88
|
-
rawBody: response.
|
|
99
|
+
rawBody: yield response.text(),
|
|
89
100
|
},
|
|
90
101
|
};
|
|
91
102
|
}
|
|
@@ -94,6 +105,7 @@ function fetcherImpl(args) {
|
|
|
94
105
|
return {
|
|
95
106
|
ok: true,
|
|
96
107
|
body: body,
|
|
108
|
+
headers: response.headers,
|
|
97
109
|
};
|
|
98
110
|
}
|
|
99
111
|
else {
|
|
@@ -108,7 +120,7 @@ function fetcherImpl(args) {
|
|
|
108
120
|
}
|
|
109
121
|
}
|
|
110
122
|
catch (error) {
|
|
111
|
-
if (error.
|
|
123
|
+
if (error instanceof Error && error.name === "AbortError") {
|
|
112
124
|
return {
|
|
113
125
|
ok: false,
|
|
114
126
|
error: {
|
|
@@ -116,11 +128,20 @@ function fetcherImpl(args) {
|
|
|
116
128
|
},
|
|
117
129
|
};
|
|
118
130
|
}
|
|
131
|
+
else if (error instanceof Error) {
|
|
132
|
+
return {
|
|
133
|
+
ok: false,
|
|
134
|
+
error: {
|
|
135
|
+
reason: "unknown",
|
|
136
|
+
errorMessage: error.message,
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
}
|
|
119
140
|
return {
|
|
120
141
|
ok: false,
|
|
121
142
|
error: {
|
|
122
143
|
reason: "unknown",
|
|
123
|
-
errorMessage: error
|
|
144
|
+
errorMessage: JSON.stringify(error),
|
|
124
145
|
},
|
|
125
146
|
};
|
|
126
147
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getHeader(headers: Record<string, any>, header: string): string | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getHeader = void 0;
|
|
4
|
-
function getHeader(
|
|
5
|
-
for (const [headerKey, headerValue] of Object.entries(
|
|
4
|
+
function getHeader(headers, header) {
|
|
5
|
+
for (const [headerKey, headerValue] of Object.entries(headers)) {
|
|
6
6
|
if (headerKey.toLowerCase() === header.toLowerCase()) {
|
|
7
7
|
return headerValue;
|
|
8
8
|
}
|
package/core/fetcher/index.d.ts
CHANGED
package/core/fetcher/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Supplier = exports.fetcher = void 0;
|
|
3
|
+
exports.Supplier = exports.getHeader = exports.fetcher = void 0;
|
|
4
4
|
var Fetcher_1 = require("./Fetcher");
|
|
5
5
|
Object.defineProperty(exports, "fetcher", { enumerable: true, get: function () { return Fetcher_1.fetcher; } });
|
|
6
|
+
var getHeader_1 = require("./getHeader");
|
|
7
|
+
Object.defineProperty(exports, "getHeader", { enumerable: true, get: function () { return getHeader_1.getHeader; } });
|
|
6
8
|
var Supplier_1 = require("./Supplier");
|
|
7
9
|
Object.defineProperty(exports, "Supplier", { enumerable: true, get: function () { return Supplier_1.Supplier; } });
|
package/core/index.d.ts
CHANGED
package/core/index.js
CHANGED
|
@@ -29,5 +29,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.serialization = void 0;
|
|
30
30
|
__exportStar(require("./fetcher"), exports);
|
|
31
31
|
__exportStar(require("./streaming-fetcher"), exports);
|
|
32
|
-
__exportStar(require("./form-data-utils"), exports);
|
|
33
32
|
exports.serialization = __importStar(require("./schemas"));
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { Readable } from "stream";
|
|
2
|
+
import { Readable } from "node:stream";
|
|
3
|
+
import { ReadableStream } from "stream/web";
|
|
3
4
|
export declare class Stream<T> implements AsyncIterable<T> {
|
|
4
5
|
private stream;
|
|
5
6
|
private parse;
|
|
6
7
|
private terminator;
|
|
7
8
|
constructor({ stream, parse, terminator, }: {
|
|
8
|
-
stream: Readable;
|
|
9
|
+
stream: Readable | ReadableStream;
|
|
9
10
|
parse: (val: unknown) => Promise<T>;
|
|
10
11
|
terminator: string;
|
|
11
12
|
});
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var getHeader_1 = require("./getHeader");
|
|
5
|
-
Object.defineProperty(exports, "getHeader", { enumerable: true, get: function () { return getHeader_1.getHeader; } });
|
|
3
|
+
exports.Stream = void 0;
|
|
6
4
|
var Stream_1 = require("./Stream");
|
|
7
5
|
Object.defineProperty(exports, "Stream", { enumerable: true, get: function () { return Stream_1.Stream; } });
|
|
8
|
-
var StreamingFetcher_1 = require("./StreamingFetcher");
|
|
9
|
-
Object.defineProperty(exports, "streamingFetcher", { enumerable: true, get: function () { return StreamingFetcher_1.streamingFetcher; } });
|
package/dist/Client.d.ts
CHANGED
|
@@ -24,6 +24,18 @@ export declare namespace VellumClient {
|
|
|
24
24
|
export declare class VellumClient {
|
|
25
25
|
protected readonly _options: VellumClient.Options;
|
|
26
26
|
constructor(_options: VellumClient.Options);
|
|
27
|
+
/**
|
|
28
|
+
* Executes a deployed Prompt and returns the result.
|
|
29
|
+
* @throws {@link Vellum.BadRequestError}
|
|
30
|
+
* @throws {@link Vellum.ForbiddenError}
|
|
31
|
+
* @throws {@link Vellum.NotFoundError}
|
|
32
|
+
* @throws {@link Vellum.InternalServerError}
|
|
33
|
+
*/
|
|
34
|
+
executePrompt(request: Vellum.ExecutePromptRequest, requestOptions?: VellumClient.RequestOptions): Promise<Vellum.ExecutePromptResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* Executes a deployed Prompt and streams back the results.
|
|
37
|
+
*/
|
|
38
|
+
executePromptStream(request: Vellum.ExecutePromptStreamRequest, requestOptions?: VellumClient.RequestOptions): Promise<core.Stream<Vellum.ExecutePromptEvent>>;
|
|
27
39
|
/**
|
|
28
40
|
* Executes a deployed Workflow and streams back its results.
|
|
29
41
|
*/
|
|
@@ -36,6 +48,16 @@ export declare class VellumClient {
|
|
|
36
48
|
* @throws {@link Vellum.ForbiddenError}
|
|
37
49
|
* @throws {@link Vellum.NotFoundError}
|
|
38
50
|
* @throws {@link Vellum.InternalServerError}
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* await vellum.generate({
|
|
54
|
+
* requests: [{
|
|
55
|
+
* inputValues: {}
|
|
56
|
+
* }],
|
|
57
|
+
* options: {
|
|
58
|
+
* logprobs: Vellum.LogprobsEnum.All
|
|
59
|
+
* }
|
|
60
|
+
* })
|
|
39
61
|
*/
|
|
40
62
|
generate(request: Vellum.GenerateBodyRequest, requestOptions?: VellumClient.RequestOptions): Promise<Vellum.GenerateResponse>;
|
|
41
63
|
/**
|
|
@@ -60,12 +82,22 @@ export declare class VellumClient {
|
|
|
60
82
|
* @throws {@link Vellum.BadRequestError}
|
|
61
83
|
* @throws {@link Vellum.NotFoundError}
|
|
62
84
|
* @throws {@link Vellum.InternalServerError}
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* await vellum.submitCompletionActuals({
|
|
88
|
+
* actuals: []
|
|
89
|
+
* })
|
|
63
90
|
*/
|
|
64
91
|
submitCompletionActuals(request: Vellum.SubmitCompletionActualsRequest, requestOptions?: VellumClient.RequestOptions): Promise<void>;
|
|
65
92
|
/**
|
|
66
93
|
* Used to submit feedback regarding the quality of previous workflow execution and its outputs.
|
|
67
94
|
*
|
|
68
95
|
* **Note:** Uses a base url of `https://predict.vellum.ai`.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* await vellum.submitWorkflowExecutionActuals({
|
|
99
|
+
* actuals: []
|
|
100
|
+
* })
|
|
69
101
|
*/
|
|
70
102
|
submitWorkflowExecutionActuals(request: Vellum.SubmitWorkflowExecutionActualsRequest, requestOptions?: VellumClient.RequestOptions): Promise<void>;
|
|
71
103
|
protected _deployments: Deployments | undefined;
|