Skip to content
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

Asking for C# code generates C# but TS project #89

Open
arturl opened this issue Jun 11, 2024 · 2 comments
Open

Asking for C# code generates C# but TS project #89

arturl opened this issue Jun 11, 2024 · 2 comments
Labels
kind/enhancement Improvements or new features

Comments

@arturl
Copy link
Member

arturl commented Jun 11, 2024

What happened?

  1. Navigate to https://www.pulumi.com/ai
  2. Without changing the language at the bottom dialog (i.e. leaving TypeScript) type "C# code for Azure web application"

The tool generates a C# program while still saying "TypeScript":

image

  1. Now click the "Deploy with Pulumi" button:
    image

  2. Go through the project creation steps. The project is generated as TypeScript with C# code:

image

Example

See above

Output of pulumi about

not relevant

Additional context

While this is a user error (I should have switched the language), the experience is a trap. I explicitly asked for what I want (a C# app) and expect to get it.

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@arturl arturl added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jun 11, 2024
@AaronFriel
Copy link

Curious what you would expect in this scenario, I think we have a pretty wide array of options:

  1. Pulumi AI would override your chosen language based on the prompt - and what would the boundaries of that be, e.g.: "Write a program to deploy a C# web app" would be ambiguous?
    1. Should we remove the language selection buttons entirely, and determine how to handle if the user asks for "a program" without a language in their prompt?
  2. Pulumi AI should refuse to generate a program for "the wrong" language, be prompted to detect this situation

@AaronFriel AaronFriel removed the needs-triage Needs attention from the triage team label Jun 12, 2024
@arturl
Copy link
Member Author

arturl commented Jun 12, 2024

The least surprising behavior would be to switch the language selector to the user-specified language.
Internally, I would add a sanity check to detect language mismatch between the generated language and the file type. As in, if we're writing C# code into a .ts file, fail hard and report an error. (Not sure if this is recoverable, if we know the user intent at that point)

@lukehoban lukehoban added kind/enhancement Improvements or new features and removed kind/bug Some behavior is incorrect or out of spec labels Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

3 participants