diff --git a/CHANGELOG.md b/CHANGELOG.md index 7110b6e..ce88525 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 1.29.0 - 2024-06-24 +### Added +- Added support for Anthropic sonnet 3.5 +- Added retry strategy to routes +- Added support for Azure OpenAI completions endpoint + +### Changed +- Changed to using sha256 hashing algorithm for computing cache key within routes + ## 1.28.4 - 2024-06-12 ### Added - Added filtering by status code for events v2 API diff --git a/docs/admin.yaml b/docs/admin.yaml index 532f28e..22c7cfb 100644 --- a/docs/admin.yaml +++ b/docs/admin.yaml @@ -1793,6 +1793,10 @@ components: $ref: "#/components/schemas/StepConfigParams" example: { "deploymentId": "ada-test", "apiVersion": "2022-12-01" } description: Params required for making Azure OpenAI requests. Required if the provider is 'azure'. + retryInterval: + type: string + example: "1s" + description: Interval between each retry. Valid units are "ms" and "s". timeout: type: string example: "5s" @@ -1821,6 +1825,11 @@ components: type: string example: "/production/chat/completion" description: Unique path for the route. + retryStrategy: + type: string + enum: ["exponential", "constant"] + example: "constant" + description: Different strategies for retries. steps: type: array items: diff --git a/internal/manager/route.go b/internal/manager/route.go index 2a70e4b..de2df0b 100644 --- a/internal/manager/route.go +++ b/internal/manager/route.go @@ -231,6 +231,17 @@ func (m *RouteManager) validateRoute(r *route.Route) error { fields = append(fields, fmt.Sprintf("steps.[%d].provider", index)) } + if len(step.RetryInterval) != 0 { + _, err := time.ParseDuration(step.RetryInterval) + if err != nil { + fields = append(fields, fmt.Sprintf("steps.[%d].retryInterval", index)) + } + + if !strings.HasSuffix(step.RetryInterval, "s") || !strings.HasSuffix(step.RetryInterval, "ms") { + fields = append(fields, fmt.Sprintf("steps.[%d].retryInterval", index)) + } + } + if !contains(step.Provider, supportedProviders) { return fmt.Errorf("steps.[%d].provider is not supported. Only azure and openai are supported", index) }