Skip to content

Conversation

JeffreySu
Copy link
Contributor

No description provided.

@JeffreySu JeffreySu merged commit 27716c8 into main Apr 29, 2025
@JeffreySu JeffreySu requested a review from Copilot April 29, 2025 09:49
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the Senparc AI Kernel to support a new combined Chat + Vision model and updates how kernels are built and configured in both production and sample code.

  • Adds two new RunChatVisionAsync overloads in KernelConfigExtensions.cs to support combined chat-vision processing.
  • Updates SemanticAiHandler.cs to use RunChatVisionAsync and introduces a kernelBuilderAction parameter.
  • Adjusts sample plugins and chat sample integration for the new functionality.

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Senparc.AI.Kernel/KernelConfigExtensions/KernelConfigExtensions.cs Introduces Chat region with new RunChatVisionAsync methods and modifies content item processing.
src/Senparc.AI.Kernel/Handlers/SemanticAiHandler.cs Updates ChatConfig and ChatAsync to integrate the new RunChatVisionAsync and adds kernelBuilderAction.
Samples/Senparc.AI.Samples.Consoles/Samples/Plugins/Objects/SearchPlugin.cs Updates method description to reflect correct functionality.
Samples/Senparc.AI.Samples.Consoles/Samples/Plugins/Objects/NowPlugin.cs New plugin added for returning the current time.
Samples/Senparc.AI.Samples.Consoles/Samples/ChatSample.cs Incorporates kernelBuilderAction for plugin registration and adjusts conversation round handling.
Files not reviewed (1)
  • src/Senparc.AI.Kernel/Senparc.AI.Kernel.csproj: Language not supported
Comments suppressed due to low confidence (1)

src/Senparc.AI.Kernel/KernelConfigExtensions/KernelConfigExtensions.cs:744

  • The variable name 'ciBae64' appears to be a typo; consider renaming it to 'ciBase64' for clarity.
else if (contentItem is ContentItem_ImageBse64 ciBae64)

Comment on lines +684 to +691
/// <param name="inStreamItemProceessing">启用流,并指定遍历异步流每一步需要执行的委托。注意:只要此项不为 null,则会触发流式的请求。</param>
/// <returns></returns>
public static Task<SenparcKernelAiResult<string>> RunChatVisionAsync(this IWantToRun iWanToRun,
SenparcAiRequest request, ChatHistory chatHistory, List<IContentItem> contentList,
PromptConfigParameter? parameter = null,
Action<StreamingKernelContent> inStreamItemProceessing = null)
{
return RunChatVisionAsync<string>(iWanToRun, request, chatHistory, contentList, parameter, inStreamItemProceessing);
Copy link
Preview

Copilot AI Apr 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter 'inStreamItemProceessing' seems misspelled; consider renaming it to 'inStreamItemProcessing' for accuracy and consistency.

Suggested change
/// <param name="inStreamItemProceessing">启用流,并指定遍历异步流每一步需要执行的委托。注意:只要此项不为 null,则会触发流式的请求。</param>
/// <returns></returns>
public static Task<SenparcKernelAiResult<string>> RunChatVisionAsync(this IWantToRun iWanToRun,
SenparcAiRequest request, ChatHistory chatHistory, List<IContentItem> contentList,
PromptConfigParameter? parameter = null,
Action<StreamingKernelContent> inStreamItemProceessing = null)
{
return RunChatVisionAsync<string>(iWanToRun, request, chatHistory, contentList, parameter, inStreamItemProceessing);
/// <param name="inStreamItemProcessing">启用流,并指定遍历异步流每一步需要执行的委托。注意:只要此项不为 null,则会触发流式的请求。</param>
/// <returns></returns>
public static Task<SenparcKernelAiResult<string>> RunChatVisionAsync(this IWantToRun iWanToRun,
SenparcAiRequest request, ChatHistory chatHistory, List<IContentItem> contentList,
PromptConfigParameter? parameter = null,
Action<StreamingKernelContent> inStreamItemProcessing = null)
{
return RunChatVisionAsync<string>(iWanToRun, request, chatHistory, contentList, parameter, inStreamItemProcessing);

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant