-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GEN AI] Improving Langfuse's tracks
- Loading branch information
Showing
8 changed files
with
62 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,16 +133,22 @@ class VectorStoreProviderSettingStatusQuery(BaseModel): | |
default=None, | ||
) | ||
|
||
class DialogDetails(BaseModel): | ||
"""The dialog details model""" | ||
|
||
dialog_id: Optional[str] = Field(description="The dialog ID.", default=None, examples=["uuid-0123"]) | ||
user_id: Optional[str] = Field(description="The user ID.", default=None, examples=["[email protected]"]) | ||
history: list[ChatMessage] = Field(description="Conversation history, used to reformulate the user's question.") | ||
tags: list[str] = Field(description='List of tags', examples=[["my-Tag"]]) | ||
|
||
|
||
class RagQuery(BaseQuery): | ||
"""The RAG query model""" | ||
|
||
history: list[ChatMessage] = Field( | ||
description="Conversation history, used to reformulate the user's question." | ||
) | ||
dialog: DialogDetails = Field(description='The user dialog details.') | ||
question_answering_prompt_inputs: Any = Field( | ||
description='Key-value inputs for the llm prompt when used as a template. Please note that the ' | ||
'chat_history field must not be specified here, it will be override by the history field', | ||
'chat_history field must not be specified here, it will be override by the dialog.history field', | ||
) | ||
# condense_question_llm_setting: LLMSetting = | ||
# Field(description="LLM setting, used to condense the user's question.") | ||
|
@@ -156,7 +162,7 @@ class RagQuery(BaseQuery): | |
) | ||
question_answering_prompt_inputs: Any = Field( | ||
description='Key-value inputs for the llm prompt when used as a template. Please note that the ' | ||
'chat_history field must not be specified here, it will be override by the history field', | ||
'chat_history field must not be specified here, it will be override by the dialog.history field', | ||
) | ||
embedding_question_em_setting: EMSetting = Field( | ||
description="Embedding model setting, used to calculate the user's question vector." | ||
|
@@ -182,13 +188,15 @@ class RagQuery(BaseQuery): | |
'json_schema_extra': { | ||
'examples': [ | ||
{ | ||
'history': [ | ||
{'text': 'Hello, how can I do this?', 'type': 'HUMAN'}, | ||
{ | ||
'text': 'you can do this with the following method ....', | ||
'type': 'AI', | ||
}, | ||
], | ||
'dialog' : { | ||
'history': [ | ||
{'text': 'Hello, how can I do this?', 'type': 'HUMAN'}, | ||
{ | ||
'text': 'you can do this with the following method ....', | ||
'type': 'AI', | ||
}, | ||
] | ||
}, | ||
'question_answering_llm_setting': { | ||
'provider': 'OpenAI', | ||
'api_key': { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters