There is no such thing as LLMTask?
Where is LLMTask I can't import it ?
from phi.llm.openai import OpenAIChat
from phi.task.llm import LLMTask
from phi.assistant import Assistant
from pydantic import BaseModel, Field
class StoryTheme(BaseModel):
setting: str = Field(..., description="This is the context of the story. If not available, provide a random setting.",)
genre: str = Field(..., description="This is the genre of the story. If not provided, select horror.")
get_story_theme = LLMTask(
system_prompt="Generate a theme for a story.",
output_model=StoryTheme,
show_output=False,
)
write_story = LLMTask(
llm=OpenAIChat(model="gpt-4"),
system_prompt="Write a 2 sentence story for a given theme. It should be less than 30 words.",
)
give_story_a_name = LLMTask(
system_prompt="Give this story a 2 word name. Format output as `Name: {name}`. Don't surround with quotes.",
)
story_assistant = Assistant(tasks=[get_story_theme, write_story, give_story_a_name])
story_assistant.cli_app(user="Theme")
@WuQic i am really sorry about this, we just removed the LLMTask module in 2.4 (announced in our channel)
We updated the docs but probably missed some code. The Task structure is now a part of a Workflow. If you can share what you're looking to build we can help put it together
Okay, I see, I want to implement a multitasking flow of tool function calls, how can I do it, I want to complete a workflow by LLM automatically identifying what tool function is being called, or by calling multiple functions
@WuQic a regular Assistant might also work here but here are some examples of Workflows:
Please share exact Workflow and Tasks and i'll give you code to execute :)
Ok, thank you very much, I'll take a look at the example first