Skip to content

Is it possible to generate a dataset based on exisiting documents using ollama, openai . #229

Answered by scosman
Anandhfullstack asked this question in Q&A
Discussion options

You must be logged in to vote

You probably should be creating Tasks, and using it to produce TaskRuns. Creating TaskRuns directly would only be better if you already had the results.

Below is an example pulled from the tests you can modify to do this.

Roughly:

  • Create a Task with your output schema as JSON schema. See build_structured_output_test_task for example. Saving it is optional.
  • Get an adapter for the task adapter = adapter_for_task(task, model_name=model_name, provider=provider)
  • Run the adapter to get a TaskRun: await adapter.invoke("input"). The example calls invoke_returning_raw which doesn't produce a TaskRun.
def build_structured_output_test_task(tmp_path: Path):
    project = datamodel.Project(name="tes…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Anandhfullstack
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #224 on February 26, 2025 19:58.