# data[].attributes.headline
RESPONSE:  Great ideas.  Keep them coming.

# data[].attributes.subject
RESPONSE:  Great ideas.  Keep them coming.

# data[].attributes.body
The ChatUWM team is rolling out features or fixes almost daily, so be sure to refresh.

# data[].attributes.body
Providing a way to save and share Prompt Templates would be very helpful!

# data[].attributes.body
Im sure this is in sight! A vector db will be awesome to provide a more targeted context and circumvent the context window.

# data[].attributes.body
Due to the limitations of PowerApps, Enter is not available for ChatUWM. Currently the best we can provide is Tab + Enter.

# data[].attributes.body
When versions 0.1 and 0.2 were active, I created a set of chats and responses. I just upgraded to 0.4 today and noticed the history of those chats and responses is missing. Do we have the ability to retrieve previous chat history? Or is all older history gone?

# data[].attributes.body
This model's maximum context length is 8192 tokens. However, your messages resulted in 8612 tokens. Please reduce the length of the messages.

^^ Is that the sum total of the chat?

I experimented with 'What is 2+2?' and received the same warning, which leads me to believe it is not the tokens needed for the next response - instead some combination of all previous.

Thx

# data[].attributes.body
Keep the questions coming. We will anwser as many as we can. As we gather feedback, decisions on the tool are being made almost daily. Stay tuned for more features and functionality.

# data[].attributes.body
has this been talked about before? thx

# data[].attributes.headline
I've seen a few typos, not in responses provided but in the verbiage that shows while waiting for a response to load. Might be good to audit those for accuracy

# data[].attributes.subject
I've seen a few typos, not in responses provided but in the verbiage that shows while waiting for a response to load. Might be good to audit those for accuracy

# data[].attributes.headline
RESPONSE: Plain ChatUWM may provide inaccurate results.  Enabling DocSearch will cite the source of any information it provides.

# data[].attributes.subject
RESPONSE: Plain ChatUWM may provide inaccurate results.  Enabling DocSearch will cite the source of any information it provides.

# data[].attributes.body
Be aware that leading prompts produce leading results that may not be accurate. Information on UWM is limited at this time.

# data[].attributes.headline
Consider adding a pop-up that explains what the icons mean

# data[].attributes.subject
Consider adding a pop-up that explains what the icons mean

# data[].attributes.body
It would be nice if there was a feature that shows what each icon is for if you hover over it. There's a hashtag icon and I wasnt sure what it did so I tried hovering my mouse over it to see if that helped but nothing came up. For example, I mean something like this.

# data[].attributes.body
It would be nice if ChatUWM was able to format tables and text in fancy ways

# data[].attributes.body
The hints should last a bit longer to allow the user to read them before they swap out

# data[].attributes.body
Is it possible to make the edit button visible without needing to click on the prompt? That way, users will know they can edit their prompt without needing to start over or add extra details below?

# data[].attributes.body
When using Chrome, after entering a prompt/question the ui can sometimes start shaking violently due to the chat boxes changing sizes. This does not appear to happen when using Edge instead.

# data[].attributes.headline
RESPONSE: Be sure to verify information pulled from the plain ChatUWM responses.

# data[].attributes.subject
RESPONSE: Be sure to verify information pulled from the plain ChatUWM responses.

# data[].attributes.body
This tool will confidently provide incorrect answers occasionally if led that way. Be sure to double check information provided for accuracy.

# data[].attributes.body
Embeddings are going to be critical when building domain-specific applications using ChatUWM. When building the API abstraction layer, it'll be important account for this. More info, if it wasn't blocked: https://platform.openai.com/docs/guides/embeddings

# data[].attributes.attachment_link.readable_text
Once we have loaded the CSV file into a Pandas DataFrame, we will set the index to the following columns:

We will use the index to search in the created embeddings during the next steps.

Now we get to the exciting part, how to use the embeddings endpoint with the GPT-4 chat model to create a chatbot that will answer questions based on the data file we created in the previous step. I found part of the code in t he OpenAI cookbook, which is a great source of information with many examples on using the OpenAI endpoints.

Also, before starting, you should declare these two variables for defining the embedding and completions model you wish to use; I will be using the latest available models at the time of writing.

EMBEDDING_MODEL = "text-embedding-ada-002"
COMPLETIONS_MODEL = "gpt-4"

We should now write two functions that generate embeddings for the legislation articles. An embedding is a numerical representation of text we use to understand its content and meaning.

1. get_embedding: This function takes a piece of text as input and calls the OpenAI Embedding API to create an embedding. The API returns the embedding as a list of floating-point numbers.

2. compute_doc_embeddings: This function takes a pandas DataFrame as input, which contains the documents you want to generate embeddings for. It iterates through each row of the DataFrame, calling the get_embedding() function to create an embedding for the content of that row. The function then returns a dictionary, where the keys are the index of each row, and the values are the corresponding embeddings.

The resulting dictionary, document_embeddings, stores these. Calculating these embeddings should take around 20 seconds.
('Subject-matter and objectives', 'Article 1') : [0.0056440141052007675, -0.000680555822327733, 0.03105766884982586, -0.019320612773299217, -0.017312467098236084]... (1536 entries)
We have split the document into sections and created embedding vectors for each article. In the next step, we will use these embeddings for finding the correct articles based on a prompt.

When a users asks a question, we will compute the embedding for that prompt and then use the vector_similarity function to find the most relevant articles related to that prompt by comparing their vectors. Finally, we will order the articles by similarity using the order_by_similarity function.

1. vector_similarity(x, y): This function takes two vectors (lists of numbers) as input and returns their similarity. In this case, the similarity is measured using the dot product because the input vectors are assumed to be normalized (have a length of 1)

2. order_by_similarity(query, contexts): This function takes a question (a string) and a dictionary of pre-calculated document embeddings (numerical representations of the documents). It first gets the embedding for the query using the get_embedding() function, which we have written above. Then, it calculates the similarity between the query embedding and each document embedding using the vector_similarity() function. Finally, it sorts the document sections based on their similarity to the query in descending order (from most to least relevant) and returns the sorted list.

As seen below, if we prompt the order_by_similarity function it will list all the articles with similar vectors and sort them by relevancy.

order_by_similarity("Can the commission implement acts for exchanging information?", document_embeddings)[:5]

[(0.8719881765395167, ('Exchange of information', 'Article 67')),
 (0.8202092496911475, ('Mutual assistance', 'Article 61')),
 (0.817484080779279, ('Exercise of the delegation', 'Article 92')),
 (0.8150087571577807,
 ('Transparent information, communication and modalities for the exercise of the rights of the data subject',
 'Article 12')),
 (0.8136051841803811, ('Activity reports', 'Article 59'))]

order_by_similarity("Do I have permission to review my information?", document_embeddings)[:5]

[(0.7899120212982893, ('Right of access by the data subject', 'Article 15')),
 (0.7756669692491687,
 ('Processing and public access to official documents', 'Article 86')),
 (0.7737578826366569, ('Conditions for consent', 'Article 7')),
 (0.7708844968587969, ('Right to restriction of processing', 'Article 18')),
 (0.7680579202696769,
 ('Processing of personal data relating to criminal convictions and offences',
 'Article 10'))

Now that we can determine what articles are relevant when trying to answer a prompt, we can add these articles to the chat session as context. This way, the completion engine (GPT-4) will try to synthesize an answer based on the GDPR-articles provided in the context.

First, will use a query separator to help the model distinguish between the various pieces of text:

MAX_SECTION_LEN = 2000
SEPARATOR = "\n* "
ENCODING = "gpt2" # encoding for text-davinci-003

encoding = tiktoken.get_encoding(ENCODING)
separator_len = len(encoding.encode(SEPARATOR))

f"Context separator contains {separator_len} tokens"

Then we define a function construct_prompt() that helps select the most relevant document sections based on a given question and a set of document embeddings. It then builds a prompt by concatenating these sections to a specific length limit set in the MAX_SECTION_LEN variable. Note that GPT-4 can process a huge amount of tokens at once; in the largest model (gpt-4-32k) up to 50 pages of text can be processed into a single chat session.

Set the model parameters:

COMPLETIONS_API_PARAMS = {
 # We use temperature of 0.0 because it gives the most predictable, factual answer.
 "temperature": 0.0,
 "max_tokens": 2000,
 "model

Finally let's put everything together by creating a messages list object for the chat session. We first initialize this chat session with a system message, so GPT knows the role it has to play. In this case, I added the following system message:

You are a GDPR chatbot, only answer the question by using the provided context. If your are unable to answer the question using the provided context, say 'I don't know'

After that we pass the chat session to the new openai.ChatCompletion endpoint and return the response.

We can now query the model by asking various questions about the GDPR data file we processed:

If you ask a question that cannot be found in the context, the model will be unable to respond:

print(answer_with_gpt_4("How long is my information stored ?", df, document_embeddings))

'''
OUTPUT:
Selected 3 document sections:
('Right of access by the data subject', 'Article 15')
('Information to be provided where personal data have not been obtained from the data subject', 'Article 14')
('Processing of personal data relating to criminal convictions and offences', 'Article 10')
('\nThe period for which personal data will be stored, or if that is not possible, the criteria used to determine that period, will be provided by the controller to the data subject. The specific information necessary for your situation may vary, but generally, the data storage duration or criteria should be informed by the controller.', 2167)
'''

This tutorial can help you make a chatbot using the embeddings endpoint and the gpt-4 chat completions API. With some basic Python skills, you can create a clever chatbot that can answer questions based on website FAQs, legal documentation, or any other data source you may provide. I will continue my work, and in the following article, we will explore how to add extra functionality by answering questions based on real-time data stored in an ERP system, CRM, or relational database by combining embeddings with automated query generation.

Our company: https://www.vectrix.ai

# data[].attributes.attachment_link.title
GPT-4 Chatbot Guide: Mastering Embeddings and Personalized Knowledge Bases

# data[].attributes.attachment_link.description
The recent release of GPT-4 and the chat completions endpoint allows developers to create a chatbot using the OpenAI REST Service. If you want your chatbot to use your knowledge base for answering...

# data[].attributes.body
GPT4 is way more expensive than GPT3-based models. For many tasks, GPT3 would suffice - so it may make sense to allow users to select which model they want to use, assuming that is possible.

# data[].attributes.body
This tool is quite usefull at generating very granular unit tests, which is a lot of typing saved.
It is pretty good at explaining Regex expressions in plain english

# data[].attributes.body
I'm hoping in the future we can give the AI more to work with by linking KB, Jira, and/or Bitbucket so it could answer some of the easier fundamental questions for new hires such as 'what are questionsets', or 'how do I implement commandbus to execute a query'. I understand the omission of this info was intentional, but also think it may be a missed opportunity.

# data[].attributes.body
If you're giving it large documents, chunk them up. It helps to tell the AI "1/5 pages/pieces" so it knows what you are doing.

# data[].attributes.body
There's a 5k limit on characters, so chunking documents requires manually entering them, and of course it's helpful to "1/5 pieces" tell the AI where the process is at. Could we have some way to auto-chunk documents? That way I could just copy/paste 90k characters and have the UI submit them piece by piece with appropriate prompts so that I don't have to manually do it.

# data[].attributes.body
I was feeding it multi-part documents so that it had an entire document. I've done this several times, but sometimes it just stops responding 4/7 of the way or w/e.

# data[].attributes.body
Allowing the user to have a saved custom prompt could help with responses tailored for a specific persons need

# data[].attributes.headline
I like that it will explain the why behind it's thought process like when writing a validation rule 

# data[].attributes.subject
I like that it will explain the why behind it's thought process like when writing a validation rule 

# data[].attributes.body
Will there be an update either monthly, quarterly, or annually regarding world knowledge for use with this?

# data[].attributes.body
When the chat is scrolled to the bottom, it starts to glitch out and bounce the chat window (see attached video)

# data[].attributes.body
It would be nice to have a reference or link to where ChatUWM is getting its information form so I can use that reference or link when documenting my findings.

# data[].attributes.headline
Second comment break the comment with 502 error

# data[].attributes.subject
Second comment break the comment with 502 error

# data[].attributes.headline
Capabilities and limitations are not working

# data[].attributes.subject
Capabilities and limitations are not working

# data[].attributes.headline
is it expected=> semicolon and arrow in the example

# data[].attributes.subject
is it expected=> semicolon and arrow in the example

# data[].attributes.headline
Edit button is not working to edit the message 

# data[].attributes.subject
Edit button is not working to edit the message 

# data[].attributes.body
Allow developers to integrate ChatUWM into their applications via REST.

# data[].attributes.body
It's in a pretty confusing location. Where the "New Chat" button is, I as a user expect the chat box to appear right below it, not below all the tiles. I almost missed that it appeared right there and was kind of surprised that it did since you have all this real estate right underneath the button.

# data[].attributes.body
Could be a useful enhancement to allow you to clear all chats on your side bar using the options cog on the bottom left

# data[].attributes.body
If the response from the chat is about the height of my screen, it shakes up and down making it difficult/impossible to read. Scrolling down fixes this, but then you can't see the top part of the response.

# data[].attributes.headline
gear selector for docs should be automatically on?

# data[].attributes.subject
gear selector for docs should be automatically on?

# data[].attributes.headline
A COPY button, so we can take the information and paste (work with) it without highlighting everything and hitting CTRL+C.

# data[].attributes.subject
A COPY button, so we can take the information and paste (work with) it without highlighting everything and hitting CTRL+C.

# data[].attributes.headline
Reword your prompt if ChatUWM doesn't provide an accurate response. 

# data[].attributes.subject
Reword your prompt if ChatUWM doesn't provide an accurate response. 

# data[].attributes.body
It took me a few tries to get ChatUWM to get the type of response I was looking for. Sometimes it helps to be more specific.

# data[].attributes.body
In a manner similar to ChatGPT Plus, certain users could have access to role specific plugins, assuming the infrastructure could be connected, articles and data from KB, Bitbucket, and much more could enhance certain user experiences.

# data[].attributes.headline
I know we say on here that it may not be entirely accurate, but we just need to make sure that is SUPER clear. I can see a scenario in which someone like an Underwriter/AE uses it for guidelines and does not have the full picture. So we should still verify!

# data[].attributes.subject
I know we say on here that it may not be entirely accurate, but we just need to make sure that is SUPER clear. I can see a scenario in which someone like an Underwriter/AE uses it for guidelines and does not have the full picture. So we should still verify!

# data[].attributes.headline
You have to work with it. You can refine your results as needed

# data[].attributes.subject
You have to work with it. You can refine your results as needed

# data[].attributes.body
Start a new chat every time you change topics. It reads each chat like a conversation and will use past prompts and answers to generate new answers

# data[].attributes.headline
ChatUWM recognizes UWM as the University of Wisconsin-Milwaukee, instead of United Wholesale Mortgage. I typed in simple questions with UWM in them. The answers came back talking about the university. As a company-specific tool, I think it should recognize the abbreviation. 

# data[].attributes.subject
ChatUWM recognizes UWM as the University of Wisconsin-Milwaukee, instead of United Wholesale Mortgage. I typed in simple questions with UWM in them. The answers came back talking about the university. As a company-specific tool, I think it should recognize the abbreviation. 

# data[].attributes.body
I asked ChatUWM to make a written prompt longer and received: "Received invalid response from ChatUWM, please retry or start a new chat."

# data[].attributes.body
I was in a ChatUWM response; multiple pdf documents were referenced in the body copy. However, when I accessed the pdfs, they were all the same document, even though they were numbered [doc1], [doc3] and [doc2]. They also were not in sequential order, which they should be.

Also, is there any way that when you click on the referenced pdf, it will take you to the copy that only pertains to that reference instead of the entire document, where you then have to sift through the entire document to find the referencing copy?

# data[].attributes.headline
ChatUWM says it has knowledge up to September 2021, but it is aware that Betty White died on December 31st 2021. 

# data[].attributes.subject
ChatUWM says it has knowledge up to September 2021, but it is aware that Betty White died on December 31st 2021. 

# data[].attributes.body
Giving the functionality to be on any web page with still having access to ChatUWM on a side bar.

# data[].attributes.headline
ChatUWM should have access to the current Date/Time

# data[].attributes.subject
ChatUWM should have access to the current Date/Time

# data[].attributes.body
Tried using ChatUWM to track work that I have done over the week on a day to day basis, however it is not able to track days/dates without me explicitly telling it what day I did what. Would be nice if it had access to the time and date.

# data[].attributes.body
Posted by Geof Griest
Would be nice to have an indicator on the chats that used the ChatUWM docsearch.
Also would be nice to have a timestamp/indicator on when that button was clicked to see when the results used different retrieved data.

# data[].attributes.headline
Chat title 100 characters max size warning.

# data[].attributes.subject
Chat title 100 characters max size warning.

# data[].attributes.body
Posted by Geof Griest
Appears the size limit for a chat label/title is 100 characters but allows for typing well past that limit.
Would be nice to have a warning of 100 characters max size instead of seeing it being concatenated after the fact.

# data[].attributes.body
I am giving GPT a relatively straightforward task of reading .editorconfig rules and providing a human-readable translation of those rules with correct and incorrect examples.

However, if I feed it more than seven at a time, because it takes computational time, it never completes and I get a JSON error that 'timeout' is not a valid object.

# data[].attributes.body
It would be very useful to know how many tokens have been used in the current chat and how many tokens for what has been typed in the current window. Whewn working with a large script Im sometimes getting a single response and several times no responses because the script is too long.

# data[].attributes.body
This is what I see when I click the gear icon in the lower left. Seems some elements are out of place?

# data[].attributes.body
A couple minor typos to fix on the pop screen screen when you click on the info icon in the lower right

# data[].attributes.headline
There is an "s" missing in the word session when the "your session has timed out message appears."

# data[].attributes.subject
There is an "s" missing in the word session when the "your session has timed out message appears."

# data[].attributes.body
Posted by Geof Griest
Is there a way to make it be in a Non-Dark Mode ?
White background with text in black ?

Dark mode is hard for me to look at.

# data[].attributes.body
I provided eroc status updates given from the incident managers to SSG leadership during a long-running incident and asked ChatUWM to write a summary.
From the 404 word input, a 141 word (accurate) summary was generated.
I then provided the same summary and asked ChatUWM to write it more concisely and it generated an accurate 61 word summary as well.
While learning from our incident does require digging into the "messy details," these summaries would provide greater context to help distinguish between different "Oops error" incidents and their individual impact, and to help remind folks of the original incident being the "why" behind some of our long-term solutions as those solutions are eventually implemented.

# data[].attributes.body
When the response fails, there should be a retry button so you don't have to edit and add an extra character to resubmit

# data[].attributes.body
5000 characters comes out to about ~1200 tokens. GPT4 contexts support above 8000 tokens. Can we increase the character limit?

# data[].attributes.body
Has this come up before ? I cannot open previous chats.

# data[].attributes.headline
Marking question-answer pairs as processed

# data[].attributes.subject
Marking question-answer pairs as processed

# data[].attributes.body
My problem:
Sometimes I ask a simple question or two and that's all. Other times I ask a ton of questions while exploring a broad new topic and its subtopics and concepts that ends up splintering out into tons of related sub-questions and I am scrolling back up to finish reading earlier answers that I only got halfway through before asking more questions. It becomes a necessity to re-read things I already read to remember that I already processed it or didn't or where I left off. Some way to deal with this would be amazing.

My suggestion:
A way to mark a question-answer pair as having been processed. This should change the color or something and automatically collapse the question-answer pair which could be re-expanded but the color representing "Processed" will remain the same unless you uncheck/re-click the processed button. This would be AWESOME for my workflow when exploring new topics where I ask tons of questions going down various rabbit holes and need to keep track of what I have mentally processed and what I still haven't completely and want to go back and continue to read. Maybe my workflow is just a mess, but I like using it this way and asking follow-up questions before I forget, a way to essentially mark a question-answer pair as done would immensely improve this for me. Thank you!

# data[].attributes.body
Can we add an option that offers the ability to delete full chat history? Going one by one is time consuming.

# data[].attributes.body
Is there a plan to bring chat uwm into our products? Example: a built-in chatbot that uses chat uwm/gpt for underwriters on dochub. With the sole purpose of training dochub best practices

# data[].attributes.headline
hello! when the prompt window begins to expand in length, it will block the previous response and the slide bar is unable to bring it back into view. I can provide screenshots.

# data[].attributes.subject
hello! when the prompt window begins to expand in length, it will block the previous response and the slide bar is unable to bring it back into view. I can provide screenshots.