microsoft / prompty

Prompty makes it easy to create, manage, debug, and evaluate LLM prompts for your AI applications. Prompty is an asset class and format for LLM prompts designed to enhance observability, understandability, and portability for developers.
https://prompty.ai
MIT License
148 stars 9 forks source link

Tenant switching #29

Open 07JP27 opened 6 days ago

07JP27 commented 6 days ago

Hi team,

I have joined multiple tenants. When I try to run a prompty file in VS Code, the default tenant is selected automatically. However, the Azure OpenAI model I am trying to use is deployed in another tenant, so I cannot authenticate with AAD.

Is there any way to switch tenants when running a prompt or a workaround for this issue?

sethjuarez commented 4 days ago

Great question - the extension relies on the underlying system settings when it comes to identity. My go to approach is to use the az login approach to sign in to the right places. Let me know what you think.

07JP27 commented 3 days ago

I also confirmed that vscode.authentication.getSession() is used in the prompty extension's code.

Creating and using the CLI is a good idea to realize this issue, and it allows execution in other IDEs or shells. If you still keep the VS Code extension, you can emit the CLI command behind the GUI action.

The CLI command I hope:

prompty login --tenant xxxxxxxxxxxxxx (-> Browser poping up)
prompty create --file xxxxx.prompty
prompty run --file xxxxx.prompty
prompty generate --lang-chain --file xxxxx.prompty
prompty generate --semantic-kernel --file xxxxx.prompty
prompty generate --prompt-flow --file xxxxx.prompty
sethjuarez commented 13 hours ago

Interesting idea!! I will label this as a feature request.