def add_prompt_to_db()

in scripts/uploadCosmos.py [0:0]


def add_prompt_to_db(config_data: dict):
    """
    Create a new prompt document in the prompts container.
    Assumes the document's 'id' is either provided or generated.
    """
    try:
      created_item = config_container.create_item(body=config_data)
      logging.info(f"Prompt created with id: {created_item['id']}")
      return created_item
    except exceptions.CosmosHttpResponseError as e:
      logging.error(f"Error creating prompt: {str(e)}")
      return None