relay

package
v0.0.0-...-a5fba0a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0 Imports: 71 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlphaSearchHelper

func AlphaSearchHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)

func AudioHelper

func AudioHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)

func ClaudeHelper

func ClaudeHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)

func ConsumeResponsesQuota

func ConsumeResponsesQuota(c *gin.Context, info *relaycommon.RelayInfo, usage *dto.Usage)

ConsumeResponsesQuota applies the same settlement dispatch to HTTP and WebSocket Responses usage. Compact requests keep their separate repricing.

func EmbeddingHelper

func EmbeddingHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)

func GeminiEmbeddingHandler

func GeminiEmbeddingHandler(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)

func GeminiHelper

func GeminiHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)

func GetAdaptor

func GetAdaptor(apiType int) channel.Adaptor

func ImageHelper

func ImageHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)

func PrepareRequestBilling

func PrepareRequestBilling(c *gin.Context, info *relaycommon.RelayInfo) *types.NewAPIError

PrepareRequestBilling estimates and reserves one request's charge. Transports provide the current request body through BodyStorage or BillingRequestInput; channel retries retain the resulting billing session and pricing snapshot.

func PrepareResponsesRequest

PrepareResponsesRequest applies the same model, conversion and channel rules for HTTP and WebSocket requests. The caller closes closer after the attempt; passthrough bodies remain owned by the incoming request's BodyStorage. The returned adaptor retains route/conversion state for DoRequest/DoResponse.

func RefundFailedRequestBilling

func RefundFailedRequestBilling(c *gin.Context, info *relaycommon.RelayInfo, apiErr *types.NewAPIError) *types.NewAPIError

RefundFailedRequestBilling applies the common final-failure policy after all eligible attempts have ended. A settled BillingSession never refunds again.

func RerankHelper

func RerankHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)

func ResponsesHelper

func ResponsesHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)

func ResponsesWebSocketHelper

func ResponsesWebSocketHelper(c *gin.Context, client *websocket.Conn, runner ResponsesWSRequestRunner) *types.NewAPIError

func TextHelper

func TextHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)

func WssHelper

func WssHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)

Types

type ResponsesWSRequestRunner

type ResponsesWSRequestRunner func(*http.Request, string, func(*gin.Context) *types.NewAPIError) *types.NewAPIError

ResponsesWSRequestRunner executes the existing authentication and rate-limit middleware around one complete request, without a second HTTP connection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL