-
Notifications
You must be signed in to change notification settings - Fork 187
feat: plugin context added #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: plugin context added #3
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
| type Plugin interface { | ||
| PreHook(req *BifrostRequest) (*BifrostRequest, error) | ||
| PostHook(result *CompletionResult) (*CompletionResult, error) | ||
| PreHook(ctx *context.Context, req *BifrostRequest) (*BifrostRequest, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let us pass in the context object and not a pointer to the context for both the pre and post hook
|
|
||
| req, err = plugin.PreHook(req) | ||
| // Create a context with timeout same as the provider/request config | ||
| ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will not create our own context, we shall ask users to pass in the context from the chat/text completion functions. keep it as the first param there. they would pass in their context to the completion functions that we shall use with in the plugin system
danpiths
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the comments

No description provided.