Skip to content

Conversation

@daxian-dbw
Copy link
Member

@daxian-dbw daxian-dbw commented Oct 25, 2024

PR Summary

Add authentication to the Azure agent.

  • Generate DL token using the new "conversation start" API
  • Refresh token potentially before each query
  • Update the interface method RefreshChatAsync to take another parameter bool force, to indicate whether or not to force creating a new chat session. Only /refresh command will call this method with force = true, because that's an explicit action from user to refresh the current chat session. In other cases, it's up to the agent to decide how it want to do the refreshing, for example, refreshing the token only, or reload the setting.
    • This change is required by the Azure agent. A user only gets fixed number of chat sessions per day, so we don't want to keep creating new chat sessions when user is simply switching agents.
    • For a soft refresh, the Azure agent will try refreshing the DL token if there is an existing chat session, and otherwise, it starts a new chat session.
    • For a hard refresh (forced), the Azure agent will end the current chat session if there is one and start a new chat session.

@daxian-dbw daxian-dbw merged commit bc98e6d into PowerShell:main Oct 25, 2024
4 checks passed
@daxian-dbw daxian-dbw deleted the auth branch October 25, 2024 18:14
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