I am very impressed by the scope and clarity of the Weaviate help docs. The help search is very competent too.
But then it hit me. Why do I find myself reading many pages of Weaviate docs and doing doc searches to generate code to use Weaviate Cloud Services? A little ironic I think?
How about using your stuff to build a fine tuned LLM that WCS customers can chat with to build code samples to execute Weaviate services? I feel silly suggesting this, but perhaps it is sillier that it does not exist.
Hi Robert!!
Do you know about Verba?
Project repo: GitHub - weaviate/Verba: Retrieval Augmented Generation (RAG) chatbot powered by Weaviate
Online demo with Weaviate content:
https://verba.weaviate.io/
It is a demo project that makes doing Rag very easy. It now has a lot of Weaviate data (youtube videos, docs, etc)
It’s not a fine tuned LLM, but the online demo is a RAG for all things Weaviate.
1 Like
Thanks, I can definitely use that! But my feature suggestion was more along the lines the way many coders use ChatGPTPlus or Copilot, where the chat-bot itself writes the Weaviate code itself based on the developer’s prompt.
Example: “I need the JavaScript code for a wcs query that will search my collection named ‘Articles’, filter out any articles published before 2024, and generate an answer using all the results returned. I only want at most 5 results to be included in the answer.”
That would be a grouped task generative query of course, like shown in the quickstart tutorial.
Oh… We are experimenting something in our slack, in the #ask-ai
here is the answer I got from your request. not perfect, but getting there…
Based on the information provided in the knowledge sources, you can use the Weaviate JavaScript client to perform a query on your ‘Articles’ collection, filter out articles published before 2024, and generate an answer using all the results returned. However, the knowledge sources do not provide a complete example of how to generate an answer using all the results returned.Here is an example of how you can perform a query and filter out articles published before 2024:
javascript
import weaviate, { WeaviateClient, ApiKey } from 'weaviate-ts-client';
const client: WeaviateClient = weaviate.client({
scheme: 'https',
host: 'WEAVIATE_INSTANCE_URL', // Replace with your Weaviate endpoint
apiKey: new ApiKey('YOUR-WEAVIATE-API-KEY'), // Replace with your Weaviate instance API key
headers: { 'X-OpenAI-Api-Key': 'YOUR-OPENAI-API-KEY' }, // Replace with your inference API key
});
async function queryArticles() {
const res = await client.graphql
.get()
.withClassName('Article')
.withFields('title _additional { creationTimeUnix }')
.withWhere({
path: ["_creationTimeUnix"],
operator: GreaterThan,
valueDate: "2024-01-01T00:00:00+00:00"
})
.withLimit(5)
.do();
console.log(JSON.stringify(res, null, 2));
return res;
}
await queryArticles();
This code will return at most 5 articles that were published after 2024. The _creationTimeUnix
field is used to filter the articles based on their publication date. Please replace 'WEAVIATE_INSTANCE_URL'
, 'YOUR-WEAVIATE-API-KEY'
, and 'YOUR-OPENAI-API-KEY'
with your actual Weaviate instance URL, API key, and OpenAI API key respectively.For generating an answer using all the results returned, you might need to use the generate
function provided by the Weaviate client. However, the knowledge sources do not provide enough information on how to use this function with multiple results. You might want to refer to the Weaviate documentation for more details.
1 Like
Thanks. Got a version for the beta JS/TS package? The syntax is way cleaner and easier to follow than the original.