Skip to content

Eclipse-SDV-Hackathon-Chapter-Two/challenge-sdv-coding-companion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 

Repository files navigation

Welcome to the SDV Coding Companion GenAI Hackathon Challenge!

apply-creditsg

Overview

Eclipse Autowrx is the open-source implementation of digital.auto (digital.auto), an industry-wide initiative that enables a digital-first approach to creating next-generation customer experiences and data-driven mobility services. Designed as an open ecosystem with a use-case-centric approach, digital.auto brings together automotive original equipment manufacturers (OEMs), suppliers, and partners to drive industry transformation. This global initiative is built on two foundational pillars of automotive technology development: the software-defined vehicle (SDV) and standardized vehicle APIs. Eclipse Autowrx aims to combine established standards with best practices and methodologies that translate technology into tangible business value.

Challenge Summary

In this challenge, participants will build GenAI models on AWS Bedrock and deploy them on the digital.auto Playground to create new Software-defined Vehicle (SDV) features. The challenge is structured into three main sub-tasks:

  1. Python Code SDV Copilot: Develop a copilot that can interact with various COVESA Vehicle Signal Sepcification (VSS) APIs to build prototype vehicle applications.
  2. Dashboard Copilot: Build a copilot that manages widget layouts on the digital.auto Playground dashboard.
  3. JavaScript/HTML Code Widget Copilot: Create a copilot to visualize individual vehicle functions and support COVESA VSS APIs.

Hackathon coaches: Chris Cheng, Ismail Gharsallah.

You can refer to the event poster here: Link to Poster.

Getting Started

This guide will walk you through accessing your free AWS credits, setting up your project, building a GenAI model on AWS Bedrock, and deploying it on the digital.auto Playground. Follow each step to maximize your AWS Bedrock credits and successfully develop your project. .


How to Access Your Free AWS Credits

  1. Visit the Hackathon Coaches
    • Share your team name, an email address, and a brief outline of your plan for the challenge with the coaches.
    • The coach will create an IAM user for your team and send the account credentials file to the provided email address.

How to Access the AWS Bedrock Console

  1. Log in to AWS

    • Copy your IAM user credentials and password in the file, then click "Open AWS Bedrock."

    • Enter your IAM username and password, then sign in.

      fill-username-password
  2. Navigate to the AWS Bedrock Console

    • Use the search bar to find "AWS Bedrock," then access the Bedrock Console. search-bedrock
  3. Set Your Region

    • Change the AWS region to US East (N. Virginia) - us-east-1 to ensure access to all available LLM models. bedrock-console

Building Your GenAI Model on Bedrock

  1. Access the Playground

    • In the AWS Bedrock Console, navigate to the Playground/Chat section to begin experimenting. playground-chat
  2. Choose Your Model

    • Select a provider and model, then click “apply” to return to the Playground chat interface. select-model apply-model
  3. Experiment with a Simple Prompt

    • Try entering a prompt such as: “Generate an SDV Python code to open the driver’s door.” input-prompt general-result
    • Note that the initial output may include extra comments—adjustments are often needed to refine the response.
  4. Refining Model Responses with System Messages

    • Use “system messages” to provide context and instructions for the model, improving accuracy and relevance. Below are example system messages to use as templates (do not copy them directly): system-message
    • Tip: Use these templates as a base. Under “Instruction,” enter general guidelines, and under “Requirement,” place specific requests for your project’s needs. Once you identify an effective instruction or system message, save it and consider submitting it to marketplace.digitalauto.tech for public use.
  5. Testing the Refined Code

    • After adding instructions, the output should contain only the code, optimized for the Playground environment.

      pure-code
    • Paste the code into the Code tab, run the prototype, and observe any API value changes. code-test code-test2

  6. Enhance with Widgets

    • To visualize API values more effectively, add widgets to your prototype. If you are new to the Playground, start by building a basic prototype for hands-on practice.

How to Submit Your GenAI Model

  1. Access the Marketplace

  2. Log In

    • If you’ve previously logged into the GenAI website, your login should carry over. If you are not logged in, please use the same account you registered with.
  3. Add a New Package

    • Click Add Package to create a new submission.

      add-package
  4. Fill in the Package Information

    • Basic Information: Include a package name, short description, and detailed description. Set visibility to Public.

    • basic-info
    • Category: Select GenAI and choose the corresponding type of GenAI model.

    • Credentials and Config: Copy these from the Review Your Team screen from the previous step. For endpoint URL, follow the syntax provided below.

      Endpoint URL Syntax:

      https://bedrock-runtime.us-east-1.amazonaws.com/model/<model_id>/invoke-with-response-stream
      

      For model-specific details, refer to AWS documentation.
      Example: If you’re using the Claude 3 Sonnet model:

      https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-sonnet-20240229-v1:0/invoke-with-response-stream
      
      fill-credentials-and-config
    • Add Images: Upload a Package Icon, Package Cover, and Feature Images (at least one required for feature images).

  5. Submit Your GenAI

    • Once you’ve filled in all the information, click Submit to submit your GenAI.
  6. View Your Submissions

    • To view all your submissions, click on the My Package tab in the website header.

Note: To submit another GenAI model, start over from step 1.


How to Update Your GenAI Model

  1. Access the Marketplace

    • Navigate to My Package on marketplace.digital.auto after logging in. navigate-package
  2. Select Your GenAI Package

    • Find and select the GenAI package you wish to update.
  3. Update the Package

    • Click the Update button to modify your submission.

      update-package
  4. Adjust the Deployment URL, Credentials, and Instructions

    • Make necessary changes to your endpoint URL, credentials, and system instructions, then save the updated package.

      deployment-adjust

How to Use GenAI on the Playground

1. SDV ProtoPilot (GenAI Python)

  • Click on the SDV ProtoPilot button.

    sdv-protopilot
  • Enter your input prompt and select a generator.

    sdv-protopilot-prompt
  • Choose a generator from the marketplace. Your own generator will appear once approved by the admin.

  • Click Generate and wait 30-90 seconds for the code to be generated. The time may vary depending on model training.

    sdv-protopilot-result
  • If you are satisfied with the generated code, click Add new generated code.

    sdv-protopilot-add

2. Dashboard ProtoPilot (GenAI Dashboard)

  • Go to the Dashboard Config tab and click the Dashboard ProtoPilot button. dashboard-config

  • Select a generator from the marketplace. Your own generator will appear once approved by the admin. select-generator

  • Enter your input prompt and click Generate. Wait for the dashboard to be generated. input-prompt

  • Once generated, you’ll see the dashboard configuration. Click View Dashboard to view the raw configuration. view-dashboard

  • If satisfied, click Add new dashboard config to add it.

    add-config

3. Widget ProtoPilot (GenAI Widget)

  • Go to the Dashboard Config tab and add a widget by clicking the Widget ProtoPilot button. add-widget

  • Select a generator from the marketplace. Your own generator will be displayed once approved. widget-generator

  • Enter your prompt and click Generate. Wait for the widget to be generated. add-widget

  • After it’s generated, you can preview it embedded in an iframe. If it meets your expectations, click Add Widget to add it to your selected dashboard box.

    add-widget-to-dash
  • To view or modify the widget code, hover over the widget box and click the icon linking to Widget Studio. You can edit the HTML, CSS, and JavaScript of the widget.

    widget-studio1 widget-studio2

4. How Playground Handles GenAI Responses

Engaging with a GenAI model through the Playground requires structured responses to ensure seamless interaction and compatibility across various hosting environments, whether it’s Amazon Bedrock or a custom infrastructure. Here’s a creative breakdown of how it all works.

The Mechanism of Communication: Leveraging HTTP POST

The Playground communicates with GenAI models using HTTP POST requests. These requests include not just the user’s input, but also optional system directives to guide the model's behavior. This approach secures data transmission and maintains response consistency.

Models Hosted on Amazon Bedrock

When interacting with models on Amazon Bedrock, the requests must be meticulously crafted to include AWS credentials, the input prompt, and any guiding system messages. Here’s how a request might look:

{
    "url": "<Model's Endpoint URL>",
    "accessKey": "<Your AWS Access Key>",
    "secretKey": "<Your AWS Secret Key>",
    "system": "<Optional system directive>",
    "input": "<User input prompt>"
}

Sample Response: Titan Express G1

{
    "results": [
        {
            "outputText": "This is an output example for AWS Bedrock Titan Express G1."
        }
    ]
}

Sample Response: Anthropic Claude 3

{
    "content": [
        {
            "type": "text",
            "text": "This is an output example for AWS Anthropic Claude 3."
        }
    ]
}

Models Hosted on Other Infrastructures
For models hosted outside Amazon Bedrock, the request format generally involves a messages array, with each message identifying whether it's from the system or the user. These messages ensure that the model can distinguish between system directives and user inputs. Here's the format:

{
    "messages": [
        { "role": "system", "content": "<System message>" },
        { "role": "user", "content": "<User input prompt>" }
    ]
}

Sample Response for Other Infrastructures

{
    "choices": [
        {
            "message": {
                "content": "This is an output example for models hosted on other infrastructures."
            }
        }
    ]
}

Model-Specific Response Examples

SDV ProtoPilot Response (Python Code)
For specific models, such as SDV ProtoPilot, the response might be in Python format, such as the example below where it toggles the low beam:

from sdv_model import Vehicle
import plugins
from browser import aio

vehicle = Vehicle()

async def toggle_low_beam():
    # Init the default value
    await vehicle.Body.Lights.IsLowBeamOn.set(False)
    await aio.sleep(1)

    for i in range(0, 10):
        # Get the current state of low beam
        low_beam_state = await vehicle.Body.Lights.IsLowBeamOn.get()

        # Toggle the low beam
        await vehicle.Body.Lights.IsLowBeamOn.set(not low_beam_state)
        await aio.sleep(1)

await toggle_low_beam()

Dashboard ProtoPilot Response (JSON Format)
For Dashboard ProtoPilot, the expected response format would be JSON, illustrating how widgets are structured and displayed:

{
    "auto_run": false,
    "widgets": [
        {
            "plugin": "Builtin",
            "widget": "Chart-APIs-Widget",
            "options": {
                "chartType": "line",
                "num_of_keep_item": 30,
                "chart_tick": 500,
                "signals": [
                    {
                        "api": "Vehicle.Proximity",
                        "color": "#3b82f6"
                    }
                ]
            },
            "boxes": [4, 5]
        }
    ]
}

Widget ProtoPilot Response (HTML Format)
For Widget ProtoPilot, the expected format would begin with HTML tags, reflecting how the widget content and functionality are displayed within a web environment:

<html>
    <head>
        <!-- HTML Head content with meta, styles, and scripts -->
    </head>
    <body class="h-screen grid place-items-center bg-slate-100 select-none">
        <!-- Body content with widget structure and functionality -->
    </body>
</html>

Final Integration Tips
To ensure the integration goes smoothly, always double-check the response formats from your models before integrating them with the Playground. This ensures your model’s output matches expectations and avoids potential miscommunications. By properly formatting the responses, your GenAI integration can thrive, offering smoother functionality across a wide range of use cases.


Good luck with your Hackathon project! Experiment, iterate, and take full advantage of the tools and templates available.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published