New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2.4 #199
v2.4 #199
Conversation
ashpreetbedi
commented
Apr 29, 2024
•
edited
edited
- Remove LLM Task
- Add Async Run
- Add Messages Param
- Add Workflows
phi/assistant/assistant.py
Outdated
# | ||
# -*- List of messages added to the messages list after the system prompt. | ||
# Use these for few-shot learning or to provide additional context to the LLM. | ||
add_messages: Optional[List[Union[Dict, Message]]] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels a bit confusing for me. Could be additional_messages
instead? add_messages
feel like a method for adding messages to a list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sandangel agree, will update it to be additional_messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sandangel looking for a better name for this param :/
def streamable(self) -> bool: | ||
return self.output_model is None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe with llama-index integration, we can stream partial intermediate pydantic object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sandangel this is on the list for us to implement :) maybe i hack on it tonight :)
For |
cookbook/assistants/add_messages.py
Outdated
Assistant( | ||
llm=OpenAIChat(model="gpt-3.5-turbo", stop="</answer>"), | ||
system_prompt="What is the color of a banana? Provide your answer in the xml tag <answer>.", | ||
add_messages=[{"role": "assistant", "content": "<answer>"}], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add_messages=[{"role": "assistant", "content": "<answer>"}], | |
additional_messages=[{"role": "assistant", "content": "<answer>"}], |
Maybe a mypy type check would catch this bug.
Is there a design document we can share for the |
cookbook/workflows/hackernews.py
Outdated
tools=[get_user_details], | ||
show_tool_calls=True, | ||
) | ||
|
||
hn_assistant = Assistant(name="HackerNews Assistant", team=[hn_top_stories, hn_user_researcher], debug_mode=True) | ||
hn_assistant.print_response("Tell me about the users with the top 2 stores on hackernews?", markdown=True) | ||
hn_team = Workflow( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hn_team = Workflow( | |
hn_workflow = Workflow( |