Add projects
This commit is contained in:
parent
2d3a9ad623
commit
8b607dd700
1802 changed files with 503346 additions and 2 deletions
12
backend/sdk/translator/plugin_hooks.go
Normal file
12
backend/sdk/translator/plugin_hooks.go
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
package translator
|
||||
|
||||
import "context"
|
||||
|
||||
// PluginHooks defines optional translator extension hooks provided by plugins.
|
||||
type PluginHooks interface {
|
||||
NormalizeRequest(ctx context.Context, from, to Format, model string, body []byte, stream bool) []byte
|
||||
TranslateRequest(ctx context.Context, from, to Format, model string, body []byte, stream bool) ([]byte, bool)
|
||||
NormalizeResponseBefore(ctx context.Context, from, to Format, model string, originalRequestRawJSON, requestRawJSON, body []byte, stream bool) []byte
|
||||
TranslateResponse(ctx context.Context, from, to Format, model string, originalRequestRawJSON, requestRawJSON, body []byte, stream bool) ([]byte, bool)
|
||||
NormalizeResponseAfter(ctx context.Context, from, to Format, model string, originalRequestRawJSON, requestRawJSON, body []byte, stream bool) []byte
|
||||
}
|
||||
Loading…
Reference in a new issue