-
-
Notifications
You must be signed in to change notification settings - Fork 603
add plugin provider vertexai #738
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
add plugin provider vertexai #738
Conversation
|
|
||
| public async Task<RoleDialogModel> GetChatCompletions(Agent agent, List<RoleDialogModel> conversations) | ||
| { | ||
| var hooks = _services.GetServices<IContentGeneratingHook>().ToList(); |
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 can use HookEmitter.Emit to simplify the Hook invocation
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.
Is there any example of use? I didn't find it in the rest of the implementations (HookEmitter.Emit)
Regarding the tools, they are configured through VertexAIConfiguration (Test: ToolChat). Would it be worth doing it like this?
https://github.com/tryAGI/LangChain.Providers/blob/main/src/Google.VertexAI/test/VertexAITest.cs
| public class TextCompletionProvider( | ||
| VertexAIConfiguration config, | ||
| ChatSettings settings, | ||
| ILogger<TextCompletionProvider> logger, |
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.
Please beautify the format:
public class TextCompletionProvider(VertexAIConfiguration config,
ChatSettings settings,
ILogger<TextCompletionProvider> logger,
IServiceProvider services) : ITextCompletionThere 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.
modified
| using Microsoft.Extensions.DependencyInjection; | ||
| using System; | ||
|
|
||
| namespace BotSharp.Plugin.VertexAI |
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.
Use this format:
namespace BotSharp.Plugin.VertexAI;
public class VertexAiPlugin : IBotSharpPlugin
{
...
}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.
modified
|
Hi Daniel, Thanks for your contribution, the overall coding struct is look good. Some minor changes I have commented. Thanks, |
I made an adapter to add the vertexai provider plugin from the implementation I made at https://github.com/tryAGI/LangChain.Providers/tree/main/src/Google.VertexAI/src.
The code may need some correction, it is the first one I have done, if it is functional it could be abstracted to be able to use all the providers and implementation in langchain dotnet.