Comments (5)
I made some changes in chat_agent
so that all instruction-type text will be in the system msg, so now the first user message should be removable. So in chat_agent
I'm changing this part of the code to preserve the sys msg and last msg, repeatedly drop the first msg after the sys msg.
from langroid.
Langroid should try gradually and iteratively to remove messages
This is exactly what it is already doing, and despite dropping all removable messages, the history is longer than model's context length (which implies feasible output len = ModelContextLen - HistLen < 0). It's not really a bug, but I'll catch the negative output len and throw a useful/informative err msg.
from langroid.
Agreed, not a bug. To handle this, I just removed all history messages except the 1st two messages (system and user), but I keep track of minimal info that I provide as a pending message to LLM to answer.
from langroid.
@pchalasani did your recent PR solve this issue?
from langroid.
yes
from langroid.
Related Issues (20)
- Add badge for colab and add the tabular chatting app HOT 1
- Example apps: if bad user input, retry instead of raising error & quitting
- Add example of google search + `DocChatAgent` HOT 3
- Missing API key while using GoogleSearchTool HOT 2
- Compute the cost of chat completion tasks HOT 8
- Integration with Azure OpenAI HOT 1
- DocChatAgent should take message history into account, for relevant doc retrieval
- PyPi badge not showing latest version HOT 3
- `num_tokens` reports different number of prompt tokens in contrast to OpenAI's Usage HOT 4
- Message queue communication
- Allow i/o from/to websocket
- Bug: DocChatAgent not using stand-alone query HOT 1
- test cases that uses openai after Azure test case HOT 1
- Compute cost for Azure Openai HOT 5
- Prepend Tokens/ContextLength and cost in displayed LLM output HOT 5
- Docker build failing HOT 1
- Error while constructing the tool inside `json_format_rules` HOT 3
- disable pytest when unrelated files changed HOT 1
- increase font size in docs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from langroid.