GithubHelp home page GithubHelp logo

[Paper] Outline about smart HOT 4 CLOSED

ch3njust1n avatar ch3njust1n commented on July 30, 2024
[Paper] Outline

from smart.

Comments (4)

ch3njust1n avatar ch3njust1n commented on July 30, 2024

Section: Generative API examples

Given the function name and behavior:

{
        "actions": [
            {
                "component": "device",
                "action": "save-custom-mode",
                "parameter": "study-mode",
                "commands": [
                    {
                        "component": "app",
                        "action": "disable-notifications",
                        "parameters": "",
                    },
                    {
                        "component": "device",
                        "action": "set-volume",
                        "parameters": "0",
                    },
                    {"component": "call", "action": "block-all", "parameters": ""},
                    {"component": "text", "action": "block-all", "parameters": ""},
                    {
                        "component": "call",
                        "action": "unblock",
                        "parameters": "555-555-5555",
                    },
                    {
                        "component": "text",
                        "action": "unblock",
                        "parameters": "555-555-5555",
                    },
                ],
            }
        ]
    }

text-davinci-003 generated:

# Candidate 1:
def save_custom_mode(modes):
    for mode in modes['study-mode']:
        if mode['action'] == 'disable-notifications':
            disable_notifications(mode['component'])
        elif mode['action'] == 'set-volume':
            set_volume(mode['component'], mode['parameters'])
        elif mode['action'] in ['block-all', 'unblock']:
            manage_block(mode['component'], mode['action'], mode['parameters'])

# Candidate 2:
def save_custom_mode(mode_data):
  # Parse mode data
  mode_config = mode_data['study-mode']
  # Iterate over mode data
  for config in mode_config:
    # Retrieve parameters
    component = config['component']
    action = config['action']
    parameters = config['parameters']
    
    # Execute action for component
    if component == 'app':
      if action == 'disable-notifications':
        # Disable notifications
        pass
    elif component == 'device':
      if action == 'set-volume':
        # Set the device volume
        pass
    elif component == 'call':
      if action == 'block-all':
        # Block all incoming calls
        pass
      elif action == 'unblock':
        # Unblock specific incoming call
        pass
    elif component == 'text':
      if action == 'block-all':
        # Block all incoming texts
        pass
      elif action == 'unblock':
        # Unblock specific incoming text
        pass

# Candidate 3:
def save_custom_mode(study_mode):
    mode_list = eval(study_mode)
    for mode in mode_list:
        component = mode['component']
        action = mode['action']
        parameters = mode['parameters']
        # Perform logic to save components and parameters

from smart.

ch3njust1n avatar ch3njust1n commented on July 30, 2024

Section: Generative API examples

Given the function name and behavior:

{
        "actions": [
            {
                "component": "device",
                "action": "save-custom-mode",
                "parameter": "study-mode",
                "commands": [
                    {
                        "component": "app",
                        "action": "disable-notifications",
                        "parameters": "",
                    },
                    {
                        "component": "device",
                        "action": "set-volume",
                        "parameters": "0",
                    },
                    {"component": "call", "action": "block-all", "parameters": ""},
                    {"component": "text", "action": "block-all", "parameters": ""},
                    {
                        "component": "call",
                        "action": "unblock",
                        "parameters": "555-555-5555",
                    },
                    {
                        "component": "text",
                        "action": "unblock",
                        "parameters": "555-555-5555",
                    },
                ],
            }
        ]
    }

claude-instant-v1 generated:

# Candidate 1:
def save_custom_mode({'study-mode': "[{'component': 'app', 'action': 'disable-notifications', 'parameters': ''}, {'component': 'device', 'action': 'set-volume', 'parameters': '0'}, {'component': 'call', 'action': 'block-all', 'parameters': ''}, {'component': 'text', 'action': 'block-all', 'parameters': ''}, {'component': 'call', 'action': 'unblock', 'parameters': '555-555-5555'}, {'component': 'text', 'action': 'unblock', 'parameters': '555-555-5555'}]"}):    
    pass

# Candidate 2:
def save_custom_mode(study_mode):
    pass

# Candidate 3:
def save_custom_mode({'study-mode': "[{'component': 'app', 'action': 'disable-notifications', 'parameters': ''}, {'component': 'device', 'action': 'set-volume', 'parameters': '0'}, {'component': 'call', 'action': 'block-all', 'parameters': ''}, {'component': 'text', 'action': 'block-all', 'parameters': ''}, {'component': 'call', 'action': 'unblock', 'parameters': '555-555-5555'}, {'component': 'text', 'action': 'unblock', 'parameters': '555-555-5555'}]"}):   
    pass

from smart.

ch3njust1n avatar ch3njust1n commented on July 30, 2024

Mention that to give the model greater context, the entire repo could be given to the model before deployment. The model can then use that context and the current input for generating code at run-time.

from smart.

ch3njust1n avatar ch3njust1n commented on July 30, 2024

"[Metaprogramming] ... enables expressing anticipated variability in a domain explicitly" - page 10 of Meta-programming and Model-Driven Meta-program Development

from smart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.