forcedotcom / Einstein-GPT-for-Developers

Einstein GPT For Developers
BSD 3-Clause "New" or "Revised" License
31 stars 8 forks source link

Prompting for LWC code returned an inscrutable error #28

Closed snugsfbay closed 3 months ago

snugsfbay commented 11 months ago
How can I create a LWC component to surface a user record with small user photo

returned:

lua
nmp init --type=module
snugsfbay commented 11 months ago

restating the question returned actual code:

How can I create a lightning web component to surface a user record with small user photo

returned:

<template>
  <template if:true={user}>
    <div class="user-card">
      <div class="user-photo" style={photoStyle}></div>
      <div class="user-details">
        <div class="user-name">{user.Name}</div>
        <div class="user-email">{user.Email}</div>
        <div class="user-phone">{user.Phone}</div>
      </div>
    </div>
  </template>
</template>

<style>
  .user-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #ffffff;
    padding: 10px;
    border-radius: 5px;
    width: 300px;
  }

  .user-photo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
  }

  .user-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
  }

  .user-name {
    font-size: 20px;
    font-weight: bold;
  }

  .user-email {
    font-size: 16px;
    color: #666;
    margin-top: 10px;
  }

  .user-phone {
    font-size: 16px;
    color: #666;
    margin-top: 10px;
  }
</style>
floralan commented 10 months ago

@snugsfbay Thank you for posting the issue. Our current LLM is not yet ready to generate LWC code, so it behaves oddly when prompted for LWC generation. Please stay tuned. We'll release a new version once it excels at LWC completion.

snugsfbay commented 10 months ago

@floralan I appreciate that, yet I was told in the Community Group to file an issue for this and so I have.

gbockus-sf commented 10 months ago

Thanks @snugsfbay! We'll be sure our AI team gets 👀 on it

pavan95 commented 5 months ago

Does Einstein support generation of LWC code now ? It generates only the html and not the complete bundle.

floralan commented 4 months ago

@pavan95 We are now supporting LWC Inline Autocompletions for CSS, HTML, Javascript. Could you please update to the latest version and try it out? Thank you for your feedback!

smarvez commented 3 months ago

Closing this issue out since we now support LWC for Inline Autocompletions. If you continue to have trouble please re-open this issue or create a new one. Thanks!