Skip to content
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

fix: User Story - 7014 | Feature add-on - Chat returns - Research if we can display output data in a table format #136

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ClientAdvisor/AzureFunction/function_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,21 @@ async def stream_openai_text(req: Request) -> StreamingResponse:
settings.max_tokens = 800
settings.temperature = 0

# Read the HTML file
with open("table.html", "r") as file:
html_content = file.read()

system_message = '''you are a helpful assistant to a wealth advisor.
Do not answer any questions not related to wealth advisors queries.
If the client name and client id do not match, only return - Please only ask questions about the selected client or select another client to inquire about their details. do not return any other information.
Only use the client name returned from database in the response.
If you cannot answer the question, always return - I cannot answer this question from the data available. Please rephrase or add more details.
** Remove any client identifiers or ids or numbers or ClientId in the final response.
For any questions requiring a table, always render the table using the following HTML format:
'''

# Make sure you have the system prompt always at the end to append the html content.
system_message += html_content

user_query = query.replace('?',' ')

Expand Down
11 changes: 11 additions & 0 deletions ClientAdvisor/AzureFunction/table.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Include the table here -->
<table style="border: 1px solid #C8C6C4; width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 1em; font-family: Segoe UI">
<tr>
<th style="background-color: #F3F2F1; padding: 12px 15px; border: 1px solid #ddd; text-align: left;">Header 1</th>
<th style="background-color: #F3F2F1; padding: 12px 15px; border: 1px solid #ddd; text-align: left;">Header 2</th>
</tr>
<tr>
<td style="padding: 12px 15px; border: 1px solid #ddd; text-align: left; color:#797775;">Data 1</td>
<td style="padding: 12px 15px; border: 1px solid #ddd; text-align: left; color:#797775;">Data 2</td>
</tr>
</table>