diff --git a/pages/authentication.mdx b/pages/authentication.mdx index 04dfbf7..ab6faf2 100644 --- a/pages/authentication.mdx +++ b/pages/authentication.mdx @@ -17,10 +17,10 @@ To enable authentication, set the `enableAuth` option to `true` when configuring For example, the following code snippet demonstrates how to enable authentication using a Firestore API key store: ```typescript copy {20} -import { getFirebaseApp } from "qvikchat/firebase"; -import { FirestoreAPIKeyStore } from "qvikchat/auth"; -import { defineChatEndpoint } from "qvikchat/endpoints"; -import { ChatAgent } from "qvikchat/agents"; +import { getFirebaseApp } from "@oconva/qvikchat/firebase"; +import { FirestoreAPIKeyStore } from "@oconva/qvikchat/auth"; +import { defineChatEndpoint } from "@oconva/qvikchat/endpoints"; +import { ChatAgent } from "@oconva/qvikchat/agents"; // Initialize Firebase App const firebaseApp = getFirebaseApp(); @@ -49,7 +49,7 @@ The API key store is a collection of API key records. It is used to manage API k You can implement your own API Key Store by implementing the `APIKeyStore` interface. The following code snippet demonstrates how to create a custom API key store: ```typescript copy -import { APIKeyStore } from "qvikchat/auth"; +import { APIKeyStore } from "@oconva/qvikchat/auth"; export class CustomAPIKeyStore implements APIKeyStore { // Implement the APIKeyStore interface diff --git a/pages/caching.mdx b/pages/caching.mdx index d57d43f..04a4b54 100644 --- a/pages/caching.mdx +++ b/pages/caching.mdx @@ -28,7 +28,7 @@ The cache store is a collection of cache records. It is used to manage cache rec You can implement your own cache store by implementing the `CacheStore` interface. The following code snippet demonstrates how to create a custom cache store: ```typescript copy -import { CacheStore } from "qvikchat/cache"; +import { CacheStore } from "@oconva/qvikchat/cache"; export class CustomCacheStore implements CacheStore { // Implement the CacheStore interface @@ -149,10 +149,10 @@ The in-memory cache store is a simple implementation of the cache store that sto To use a custom cache store in your QvikChat endpoint configurations, you need to provide an instance of the cache store in the endpoint configurations. The following code snippet demonstrates how to add a Firestore cache store to the endpoint configurations: ```typescript copy {20} -import { getFirebaseApp } from "qvikchat/firebase"; -import { FirestoreCacheStore } from "qvikchat/cache"; -import { defineChatEndpoint } from "qvikchat/endpoints"; -import { ChatAgent } from "qvikchat/agents"; +import { getFirebaseApp } from "@oconva/qvikchat/firebase"; +import { FirestoreCacheStore } from "@oconva/qvikchat/cache"; +import { defineChatEndpoint } from "@oconva/qvikchat/endpoints"; +import { ChatAgent } from "@oconva/qvikchat/agents"; // Initialize Firebase App const firebaseApp = getFirebaseApp(); diff --git a/pages/chat-agent.mdx b/pages/chat-agent.mdx index 318db9d..b1ee63e 100644 --- a/pages/chat-agent.mdx +++ b/pages/chat-agent.mdx @@ -20,7 +20,7 @@ The `ChatAgent` class can be used to create different types of chat agents based Example of defining a `close-ended` chat agent: ```typescript copy -import { ChatAgent } from "qvikchat/agents"; +import { ChatAgent } from "@oconva/qvikchat/agents"; // Define a close-ended chat agent const closeEndedChatAgent = new ChatAgent({ @@ -58,7 +58,7 @@ gpt4 ### Specifying Model ```typescript copy {7} -import { ChatAgent } from "qvikchat/agents"; +import { ChatAgent } from "@oconva/qvikchat/agents"; // Define a close-ended chat agent with a specific LLM model const closeEndedChatAgent = new ChatAgent({ @@ -73,7 +73,7 @@ const closeEndedChatAgent = new ChatAgent({ You can, optionally, also provide additional configuration options for the LLM model. ```typescript copy {7-17} -import { ChatAgent } from "qvikchat/agents"; +import { ChatAgent } from "@oconva/qvikchat/agents"; // Define a chat agent with a specific LLM model and configuration const chatAgent = new ChatAgent({ @@ -157,7 +157,7 @@ export const defaultChatAgentConfig: DefaultChatAgentConfigType = { You can generate responses to user queries using the `generateResponse` method of the `ChatAgent` class. ```typescript copy -import { ChatAgent } from "qvikchat/agents"; +import { ChatAgent } from "@oconva/qvikchat/agents"; // Define a chat agent const chatAgent = new ChatAgent(); diff --git a/pages/chat-endpoints.mdx b/pages/chat-endpoints.mdx index d5f11b0..062e965 100644 --- a/pages/chat-endpoints.mdx +++ b/pages/chat-endpoints.mdx @@ -11,7 +11,7 @@ All chat endpoints can be defined using a single method: `defineChatEndpoint`. T You can import the `defineChatEndpoint` method as shown below: ```typescript copy -import { defineChatEndpoint } from "qvikchat/endpoints"; +import { defineChatEndpoint } from "@oconva/qvikchat/endpoints"; ``` Below are the three types of chat agents you can define: diff --git a/pages/chat-endpoints/chat-endpoint-configurations.mdx b/pages/chat-endpoints/chat-endpoint-configurations.mdx index c344a25..4e1c751 100644 --- a/pages/chat-endpoints/chat-endpoint-configurations.mdx +++ b/pages/chat-endpoints/chat-endpoint-configurations.mdx @@ -3,7 +3,7 @@ You can configure a chat endpoint with various features such as chat history, response caching, and API key authentication, by simply modifying the configurations provided to the `defineChatEndpoint` function. To use this, first import the method as following: ```typescript copy -import { defineChatEndpoint } from "qvikchat/endpoints"; +import { defineChatEndpoint } from "@oconva/qvikchat/endpoints"; ``` Below are some of the chat endpoint configurations you can define. diff --git a/pages/chat-endpoints/close-ended-chat.mdx b/pages/chat-endpoints/close-ended-chat.mdx index d631295..9aa3777 100644 --- a/pages/chat-endpoints/close-ended-chat.mdx +++ b/pages/chat-endpoints/close-ended-chat.mdx @@ -5,7 +5,7 @@ Chat endpoint where user queries are restricted to a specific topic. Prevents mi You can define an close-ended chat endpoint with various features such as chat history, response caching, and API key authentication, by simply modifying the configurations provided to the `defineChatEndpoint` function. To use this, first import the method as following: ```typescript copy -import { defineChatEndpoint } from "qvikchat/endpoints"; +import { defineChatEndpoint } from "@oconva/qvikchat/endpoints"; ``` Below are some of the close-ended chat endpoints you can define. diff --git a/pages/chat-endpoints/open-ended-chat.mdx b/pages/chat-endpoints/open-ended-chat.mdx index fd2cc44..27e6f05 100644 --- a/pages/chat-endpoints/open-ended-chat.mdx +++ b/pages/chat-endpoints/open-ended-chat.mdx @@ -5,7 +5,7 @@ Unrestricted chat with no restrictions on what topic the user queries can be rel You can define an open-ended chat endpoint with various features such as chat history, response caching, and API key authentication, by simply modifying the configurations provided to the `defineChatEndpoint` function. To use this, first import the method as following: ```typescript -import { defineChatEndpoint } from "qvikchat/endpoints"; +import { defineChatEndpoint } from "@oconva/qvikchat/endpoints"; ``` Below are some of the open-ended chat endpoints you can define. @@ -134,7 +134,7 @@ For failed requests, the response will contain: Below is an example of how you can define an open-ended chat endpoint that supports chat history. Simply, set the `useChatHistory` flag to `true` and provide an a chat history store. For testing, you may use the in-memory chat history store. ```typescript copy -import { InMemoryChatHistoryStore } from "qvikchat/history"; +import { InMemoryChatHistoryStore } from "@oconva/qvikchat/history"; // Open-ended chat endpoint with support for chat history defineChatEndpoint({ diff --git a/pages/chat-endpoints/rag-chat.mdx b/pages/chat-endpoints/rag-chat.mdx index 2e1b39d..236d3a0 100644 --- a/pages/chat-endpoints/rag-chat.mdx +++ b/pages/chat-endpoints/rag-chat.mdx @@ -12,7 +12,7 @@ Context-aware and topic-specific chat with ability to answer user queries by ret You can define an RAG chat endpoint with various features such as chat history, response caching, and API key authentication, by simply modifying the configurations provided to the `defineChatEndpoint` function. To use this, first import the method as following: ```typescript -import { defineChatEndpoint } from "qvikchat/endpoints"; +import { defineChatEndpoint } from "@oconva/qvikchat/endpoints"; ``` Below are some of the RAG chat endpoints you can define. @@ -65,7 +65,7 @@ For failed requests, the response will contain: Below example uses a RAG agent to answer user queries related to 'Store Inventory Data'. We'll index this data, store it in a vector store, and use a vector store retriever to retrieve the data when answering user queries. ```typescript copy {13} -import { getDataRetriever } from "qvikchat/data-retrievers"; +import { getDataRetriever } from "@oconva/qvikchat/data-retrievers"; // Index inventory data and get retriever const inventoryDataRetriever = await getDataRetriever({ @@ -152,7 +152,7 @@ Below example hows how you can define a RAG chat endpoint that supports chat his Below RAG agent answers user queries related to 'Store Inventory Data'. We'll index this data, store it in a vector store, and use a vector store retriever to retrieve the data when answering user queries. ```typescript copy -import { getDataRetriever } from "qvikchat/data-retrievers"; +import { getDataRetriever } from "@oconva/qvikchat/data-retrievers"; // Index inventory data and get retriever const inventoryDataRetriever = await getDataRetriever({ @@ -251,7 +251,7 @@ Below example shows how you can define a RAG chat endpoint that supports chat hi Below example uses a RAG agent to answer user queries related to 'Store Inventory Data'. We'll index this data, store it in a vector store, and use a vector store retriever to retrieve the data when answering user queries. ```typescript copy -import { getDataRetriever } from "qvikchat/data-retrievers"; +import { getDataRetriever } from "@oconva/qvikchat/data-retrievers"; // Index inventory data and get retriever const inventoryDataRetriever = await getDataRetriever({ diff --git a/pages/chat-history.mdx b/pages/chat-history.mdx index 0f9fa1e..d8c0eec 100644 --- a/pages/chat-history.mdx +++ b/pages/chat-history.mdx @@ -90,7 +90,7 @@ export interface ChatHistoryStore { You can provide an instance of a chat history store to the `defineChatEndpoint` function. The chat endpoint will use this store to manage chat histories. ```typescript copy -import { InMemoryChatHistoryStore } from "qvikchat/history"; +import { InMemoryChatHistoryStore } from "@oconva/qvikchat/history"; // Open-ended chat endpoint with support for chat history defineChatEndpoint({ @@ -105,8 +105,8 @@ defineChatEndpoint({ You can use Firebase Firestore as a chat history store. Remember to initialize the Firebase app before using it. To learn more about initializing the Firebase app, check [Initialize Firebase App](/integrations/firebase#initialize-firebase-app) ```typescript copy -import { getFirebaseApp } from "qvikchat/firebase"; -import { FirestoreChatHistoryStore } from "qvikchat/history"; +import { getFirebaseApp } from "@oconva/qvikchat/firebase"; +import { FirestoreChatHistoryStore } from "@oconva/qvikchat/history"; // Initialize Firebase App const firebaseApp = getFirebaseApp(); @@ -120,4 +120,4 @@ defineChatEndpoint({ collectionName: "chat-history", }), }); -``` \ No newline at end of file +``` diff --git a/pages/getting-started.mdx b/pages/getting-started.mdx index 76ffdda..a622267 100644 --- a/pages/getting-started.mdx +++ b/pages/getting-started.mdx @@ -9,13 +9,13 @@ QvikChat is a framework built on top of Firebase Genkit and LangChain. It allows You can install QvikChat using the following command: ```bash copy -npm install qvikchat +npm install @oconva/qvikchat ``` Or ```bash copy -pnpm add qvikchat +pnpm add @oconva/qvikchat ``` ## Usage @@ -25,8 +25,8 @@ Before you can deploy your chat endpoints, you need to setup Firebase Genkit, ei Create a `index.ts` (or `index.js`) file and add the following code: ```typescript copy filename="index.ts" -import { runServer, setupGenkit } from "qvikchat/genkit"; -import { defineChatEndpoint } from "qvikchat/endpoints"; +import { runServer, setupGenkit } from "@oconva/qvikchat/genkit"; +import { defineChatEndpoint } from "@oconva/qvikchat/endpoints"; // Setup Genkit setupGenkit(); diff --git a/pages/integrations/firebase.mdx b/pages/integrations/firebase.mdx index 84789cb..6847fbf 100644 --- a/pages/integrations/firebase.mdx +++ b/pages/integrations/firebase.mdx @@ -7,7 +7,7 @@ To setup Firebase for use with QvikChat, you need to do two things: 1. Modify your genkit configurations that you provide to the `setupGenkit` function to include the Firebase configurations, and specify your Firebase project ID. ```typescript copy -import { setupGenkit } from "qvikchat/genkit"; +import { setupGenkit } from "@oconva/qvikchat/genkit"; // Setup Genkit with Firebase project setupGenkit({ @@ -34,7 +34,7 @@ That's it! You have successfully setup Firebase for use with QvikChat. You can n To initialize a Firebase app, you can use the `getFirebaseApp` function provided by QvikChat. ```typescript copy -import { getFirebaseApp } from "qvikchat/integrations/firebase"; +import { getFirebaseApp } from "@oconva/qvikchat/integrations/firebase"; // Initialize Firebase App const firebaseApp = getFirebaseApp(); @@ -45,7 +45,7 @@ When calling the `getFirebaseApp` function without passing any value for the `cr You can provide additional configurations to the `getFirebaseApp` function. For example, you can specify the path to the service account credentials file and the provide project ID. ```typescript copy -import { getFirebaseApp, credential } from "qvikchat/firebase"; +import { getFirebaseApp, credential } from "@oconva/qvikchat/firebase"; // Initialize Firebase App with additional configurations getFirebaseApp({ @@ -78,9 +78,9 @@ For more information on how to initialize a Firebase app when using `firebase-ad You can use Firestore as a chat history store. To do this, you need to provide the Firestore chat history store to the `ChatAgent` constructor. ```typescript copy -import { ChatAgent } from "qvikchat/agents"; -import { getFirebaseApp } from "qvikchat/firebase"; -import { FirestoreChatHistoryStore } from "qvikchat/history"; +import { ChatAgent } from "@oconva/qvikchat/agents"; +import { getFirebaseApp } from "@oconva/qvikchat/firebase"; +import { FirestoreChatHistoryStore } from "@oconva/qvikchat/history"; // Initialize Firebase App const firebaseApp = getFirebaseApp(); @@ -100,10 +100,10 @@ const chatAgent = new ChatAgent({ You can use Firestore as a cache store. To do this, you need to provide the Firestore cache store as the `cacheStore` to the endpoint configurations. ```typescript copy {20} -import { getFirebaseApp } from "qvikchat/firebase"; -import { FirestoreCacheStore } from "qvikchat/cache"; -import { defineChatEndpoint } from "qvikchat/endpoints"; -import { ChatAgent } from "qvikchat/agents"; +import { getFirebaseApp } from "@oconva/qvikchat/firebase"; +import { FirestoreCacheStore } from "@oconva/qvikchat/cache"; +import { defineChatEndpoint } from "@oconva/qvikchat/endpoints"; +import { ChatAgent } from "@oconva/qvikchat/agents"; // Initialize Firebase App const firebaseApp = getFirebaseApp(); @@ -128,10 +128,10 @@ defineChatEndpoint({ You can use Firestore as an API key store. To do this, you need to provide the Firestore API key store as the `apiKeyStore` to the endpoint configurations. ```typescript copy {20} -import { getFirebaseApp } from "qvikchat/firebase"; -import { FirestoreAPIKeyStore } from "qvikchat/auth"; -import { defineChatEndpoint } from "qvikchat/endpoints"; -import { ChatAgent } from "qvikchat/agents"; +import { getFirebaseApp } from "@oconva/qvikchat/firebase"; +import { FirestoreAPIKeyStore } from "@oconva/qvikchat/auth"; +import { defineChatEndpoint } from "@oconva/qvikchat/endpoints"; +import { ChatAgent } from "@oconva/qvikchat/agents"; // Initialize Firebase App const firebaseApp = getFirebaseApp(); diff --git a/pages/prompts.mdx b/pages/prompts.mdx index a718086..ee1567f 100644 --- a/pages/prompts.mdx +++ b/pages/prompts.mdx @@ -13,7 +13,7 @@ Be careful when defining system prompts. They should be clear, concise, and unam ```typescript copy import { defineDotprompt } from "@genkit-ai/dotprompt"; -import { ChatAgent } from "qvikchat/agents"; +import { ChatAgent } from "@oconva/qvikchat/agents"; // Chat agent with a custom system prompt const funnyChatAgent = new ChatAgent({ @@ -45,7 +45,7 @@ const funnyChatAgent = new ChatAgent({ You can also override the pre-configured system prompt of a chat agent by providing a custom system prompt when calling the `generateResponse` method of the chat agent. ```typescript copy {10-31} -import { ChatAgent } from "qvikchat/agents"; +import { ChatAgent } from "@oconva/qvikchat/agents"; import { defineDotprompt } from "@genkit-ai/dotprompt"; // Define an open-ended chat agent @@ -116,7 +116,7 @@ Start the message with "Sure, here is..." and provide the user with the requeste You can then use the chat prompt when generating a response to a user query. ```typescript copy {10-31} -import { ChatAgent } from "qvikchat/agents"; +import { ChatAgent } from "@oconva/qvikchat/agents"; import { defineDotprompt } from "@genkit-ai/dotprompt"; // Define an open-ended chat agent diff --git a/pages/rag-guide/data-ingestion.mdx b/pages/rag-guide/data-ingestion.mdx index 1f28b8d..10a22f3 100644 --- a/pages/rag-guide/data-ingestion.mdx +++ b/pages/rag-guide/data-ingestion.mdx @@ -41,7 +41,7 @@ To use an embedding model, simply provide the instance to the `getDataRetriever` ```typescript copy // import embedding model -import { getDataRetriever } from "qvikchat/data-retrievers"; +import { getDataRetriever } from "@oconva/qvikchat/data-retrievers"; import { OpenAIEmbeddings } from "@langchain/openai"; // Index data and get retriever @@ -66,8 +66,8 @@ QvikChat provides support for more than 30+ vector stores such as Faiss, Pinecon To use a vector store, simply provide the instance to the `getDataRetriever` method. The below example shows how you can use a Faiss vector store to store the embeddings. You will need to provide the vector store instance the embedding model you want to use with it. If you wish to use a Google Gen AI or an OpenAI embedding model, you can use the `getEmbeddingModel` method to get the embedding model instance. ```typescript copy -import { getDataRetriever } from "qvikchat/data-retrievers"; -import { getEmbeddingModel } from "qvikchat/embedding-models"; +import { getDataRetriever } from "@oconva/qvikchat/data-retrievers"; +import { getEmbeddingModel } from "@oconva/qvikchat/embedding-models"; import { FaissStore } from "@langchain/community/vectorstores/faiss"; // Index data and get retriever diff --git a/pages/rag-guide/embedding-models.mdx b/pages/rag-guide/embedding-models.mdx index 836a584..a015ddb 100644 --- a/pages/rag-guide/embedding-models.mdx +++ b/pages/rag-guide/embedding-models.mdx @@ -6,7 +6,7 @@ To use an embedding model, simply provide the instance to the `getDataRetriever` ```typescript copy // import embedding model -import { getDataRetriever } from "qvikchat/data-retrievers"; +import { getDataRetriever } from "@oconva/qvikchat/data-retrievers"; import { OpenAIEmbeddings } from "@langchain/openai"; // Index data and get retriever @@ -25,8 +25,8 @@ const dataRetriever = await getDataRetriever({ If you wish to use a Google Gen AI or an OpenAI embedding model, you can use the `getEmbeddingModel` method to get the embedding model instance. ```typescript copy -import { getDataRetriever } from "qvikchat/data-retrievers"; -import { getEmbeddingModel } from "qvikchat/embedding-models"; +import { getDataRetriever } from "@oconva/qvikchat/data-retrievers"; +import { getEmbeddingModel } from "@oconva/qvikchat/embedding-models"; import { FaissStore } from "@langchain/community/vectorstores/faiss"; // Index data and get retriever diff --git a/pages/rag-guide/vector-stores.mdx b/pages/rag-guide/vector-stores.mdx index 95a268c..f87d746 100644 --- a/pages/rag-guide/vector-stores.mdx +++ b/pages/rag-guide/vector-stores.mdx @@ -7,8 +7,8 @@ QvikChat provides support for more than 30+ vector stores such as Faiss, Pinecon To use a vector store, simply provide the instance to the `getDataRetriever` method. The below example shows how you can use a Faiss vector store to store the embeddings. You will need to provide the vector store instance the embedding model you want to use with it. If you wish to use a Google Gen AI or an OpenAI embedding model, you can use the `getEmbeddingModel` method to get the embedding model instance. ```typescript copy -import { getDataRetriever } from "qvikchat/data-retrievers"; -import { getEmbeddingModel } from "qvikchat/embedding-models"; +import { getDataRetriever } from "@oconva/qvikchat/data-retrievers"; +import { getEmbeddingModel } from "@oconva/qvikchat/embedding-models"; import { FaissStore } from "@langchain/community/vectorstores/faiss"; // Index data and get retriever