by mdaniel · 2y ago · 0 comments
IMHO it would be much clearer if you just used the normal %s for the "outer" string and left the implicit f-string syntax as it is, e.g.
{
"role": "user",
# this is not an f-string, is rather replaced by TODO FIXME
"content": "Given the context\n:{CONTEXT}\nAnswer the question: %s" % query,
},
The way the example (in both the readme and the docs) is written, it seems to imply I can put my own fileds as siblings to the chat key and they, too, will be resolved results = await collection.rag(
{
"EXAMPLE": {
"uh-huh": True
},
"CONTEXT": {
"vector_search": {
"query": {
"fields": {"text": {"query": query}},
},
"document": {"keys": ["id"]},
"limit": 1,
},
"aggregate": {"join": "\n"},
},
"chat": {
"messages": [{"content": "Given Context:\n{CONTEXT}\nAn Example:\n{EXAMPLE}"
}
One could not fault the user for thinking such a thing since the *API* docs say "see the *GUIDE*" :-( https://postgresml.org/docs/open-source/korvus/api/collectio...