Тёмный

AI chat thread history in your apps! Maintain conversation context. 

The Code Wolf
Подписаться 3,9 тыс.
Просмотров 171
50% 1

In this video, you'll learn how to preserve a conversational chat thread with an OpenAI model, which enables the AI to generate responses based on previous message. This functionality is very useful when you want the OpenAI model to refine results or work back and forth to create an ideal completion. We'll work through code examples in .NET, but the concepts and steps apply to any language.

Опубликовано:

 

10 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 4   
@GeorgeZoto
@GeorgeZoto Месяц назад
Thank you for another great content :)
@PankajNikam
@PankajNikam 2 месяца назад
Thanks for this video. It is really helpful; I am wondering if the tokens get consumed when we supply the chat history. What happens if the tokens run out (the limit set by each model)? How can we clear the history when we know that the tokens have ran out?
@alexthecodewolf
@alexthecodewolf 2 месяца назад
Thanks! Chat history does count towards token history - anything you pass to the AI generally counts as tokens. The larger your token limit for a given model, the more history you could send, for example GPT-4 32k runs out faster than GPT-4 128k. Luckily the chat history is just a standard list, so whenever you send a prompt you can update your history list to only include the X number of most recent messages, whatever you think will fit in the token limit for your model. I believe the AI model auto-truncates the tokens provided and just ignores the excess but I'd have to double check on that. You could also store all the messages in one list for the user and for display purposes, but then just take the X most recent number of messages to actually send to the AI.
@PankajNikam
@PankajNikam 2 месяца назад
@@alexthecodewolf Thanks for such detailed answer.
Далее
Local AI models! Code with Ollama and Phi3.
13:18
Просмотров 1,2 тыс.
Use AI to chat with a NoSQL database! A simple intro.
22:23