microsoft / microsoft/WindowsAppSDK

Regarding the issue of using context correlation in Windows AI Foundry ->Phi Silica

Open
#5,518 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-WCR
Dominant language
C++
Stars
4.7k
Forks
471
Avg merge
3d 13h
Merged PRs (30d)
28

Description

How to use context correlation is not well demonstrated in the example, and I am not able to effectively utilize contextual content. Can you provide corresponding support.

I have used ai dev galley. But the examples it provides cannot support contextual content well.

Its example code is to add questions and answers to prompt words.

  private string GetPrompt(IEnumerable<ChatMessage> history)
  {
      if (!history.Any())
      {
          return string.Empty;
      }
  
      string prompt = string.Empty;
  
      var firstMessage = history.FirstOrDefault();
  
      _languageModelContext = firstMessage?.Role == ChatRole.System ?
          _languageModel?.CreateContext(firstMessage.Text, new ContentFilterOptions()) :
          _languageModel?.CreateContext();
  
      for (var i = 0; i < history.Count(); i++)
      {
          var message = history.ElementAt(i);
          if (message.Role == ChatRole.System)
          {
              if (i > 0)
              {
                  throw new ArgumentException("Only first message can be a system message");
              }
          }
          else if (message.Role == ChatRole.User)
          {
              string msgText = message.Text ?? string.Empty;
              prompt += msgText;
          }
          else if (message.Role == ChatRole.Assistant)
          {
              prompt += message.Text;
          }
      }
  
      return prompt;
  }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository file, test, or entry point is identified. Start by clarifying the expected context-correlation behavior for Windows AI Foundry and Phi Silica, then review the cited GetPrompt example and determine how contextual content should be represented. Done means documenting or implementing a supported approach with a verifiable example.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
ai, desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.