-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Few Shot Chat Prompt #8038
Few Shot Chat Prompt #8038
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
let me know the change is okay -- expanded the doc-string in attempt to explain the high level structure and the purpose and added a simple example that uses static examples. I can update the documentation for chat messages in the notebooks. |
@eyurtsev Think you tagged the wrong @hinthornw |
|
||
|
||
class FewShotPromptTemplate(StringPromptTemplate): | ||
class _FewShotPromptTemplateMixin(BaseModel): |
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.
does mixin need to be BaseModel (seems like everything that uses it already is)
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.
It was giving some weird metaclass resolution things without but I'll double check that still is the case
@property | ||
def lc_serializable(self) -> bool: | ||
return False | ||
|
||
examples: Optional[List[dict]] = 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.
I'm not super convinced this abstraction is useful for static examples fwiw
3d2c584
to
aa39b59
Compare
918afe8
to
a93ecf9
Compare
Returns: | ||
List of input variables. | ||
""" | ||
return ["input"] |
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 looks inconvenient
return ["input"] | ||
|
||
def format_messages(self, **kwargs: Any) -> List[BaseMessage]: | ||
""" |
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.
""" | |
"""Format kwargs into a list of messages. |
|
||
def format_messages(self, **kwargs: Any) -> List[BaseMessage]: | ||
""" | ||
Format kwargs into a list of 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.
Format kwargs into a list of messages. |
Proposal for a few shot chat message example selector