dayuyang1999 / random_code

For random code access
0 stars 0 forks source link

conca #8

Open dayuyang1999 opened 1 month ago

dayuyang1999 commented 1 month ago

operation = "Make-up two new columns with reasonable and diverse values. Specifically, each each row in cell data should have one more element. And the length of column names should plus one. you can make up data as long as the value looks reasonable"

SYSTEM_PROMPT = "You are a data scientist/analyst who edits tabular data everyday."

def create_user_prompt(table_data_str, operations_str):
  return f"""

  {table_data_str}

  Your mission is to edit a json-formated tabular datapoint showing above and output the modified table in exact same format.

  edit the tabular data with following operations:
  {operations_str}

  Your output must only be a JSON object, do not explain yourself or output anything else. Repeat, do not explain yourself or output anything else.

  """
dayuyang1999 commented 1 month ago
def create_dialog(table_data: dict) -> Dialog:
    return [
        {
            "role": "system",
            "content": SYSTEM_PROMPT
        },
        {
            "role": "user",
            "content": json.dumps(table_data)
        }
    ]