Skip to content

Commit

Permalink
Merge pull request #105 from log10-io/wenzhe/add_instruction_feedback…
Browse files Browse the repository at this point in the history
…_task

add `--instruction` in feedback task and `--comment` in feedback cli
  • Loading branch information
nqn authored Feb 13, 2024
2 parents 7a54e49 + 1c77b8d commit b758ea4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions log10/feedback/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def create(
"task_id": task_id,
"json_values": values,
"completion_tags_selector": completion_tags_selector,
"comment": comment,
}
res = self._post_request(self.feedback_create_url, json_payload)
return res
Expand All @@ -57,9 +58,10 @@ def create(
@click.option("--task_id", prompt="Enter task id", help="Task ID")
@click.option("--values", prompt="Enter task values", help="Feedback in JSON format")
@click.option("--completion_tags_selector", prompt="Enter completion tags selector", help="Completion tags selector")
def create_feedback(task_id, values, completion_tags_selector):
@click.option("--comment", help="Comment", default="")
def create_feedback(task_id, values, completion_tags_selector, comment):
click.echo("Creating feedback")
tags = completion_tags_selector.split(",")
values = json.loads(values)
feedback = Feedback().create(task_id=task_id, values=values, completion_tags_selector=tags)
feedback = Feedback().create(task_id=task_id, values=values, completion_tags_selector=tags, comment=comment)
click.echo(feedback.json())
5 changes: 3 additions & 2 deletions log10/feedback/feedback_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ def create(self, task_schema: dict, name: str = None, instruction: str = None) -
@click.command()
@click.option("--name", prompt="Enter feedback task name", help="Name of the task")
@click.option("--task_schema", prompt="Enter feedback task schema", help="Task schema")
def create_feedback_task(name, task_schema):
@click.option("--instruction", help="Task instruction", default="")
def create_feedback_task(name, task_schema, instruction):
click.echo("Creating feedback task")
task_schema = json.loads(task_schema)
task = FeedbackTask().create(name=name, task_schema=task_schema)
task = FeedbackTask().create(name=name, task_schema=task_schema, instruction=instruction)
click.echo(f"Use this task_id to add feedback: {task.json()['id']}")
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "log10-io"

version = "0.6.1"
version = "0.6.2"
authors = ["log10 team"]
license = "MIT"
description = "Unified LLM data management"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="Log10",
version="0.6.1",
version="0.6.2",
description="Log10 LLM data management",
author="Log10 team",
author_email="team@log10.io",
Expand Down

0 comments on commit b758ea4

Please sign in to comment.