{"_id":"@curostrides/curoai","name":"@curostrides/curoai","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@curostrides/curoai","version":"1.0.0","description":"CuroAI is a JavaScript library designed for interfacing with the Curo AI system, which leverages OpenAI's powerful GPT-3.5 model for chat completions and Pinecone for efficient indexing and retrieval of chat history. This library simplifies the process of","private":false,"main":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"tsc"},"keywords":[],"author":{"name":"CuroStrides"},"license":"ISC","devDependencies":{"@typescript-eslint/eslint-plugin":"^6.7.0","eslint":"^8.49.0","eslint-config-standard-with-typescript":"^39.0.0","eslint-plugin-import":"^2.28.1","eslint-plugin-n":"^16.1.0","eslint-plugin-promise":"^6.1.1","typescript":"^5.2.2"},"dependencies":{"@pinecone-database/pinecone":"^1.0.0","openai":"^4.6.0"},"gitHead":"77d80d8434270b3f2ed72d0cf56131f2a3157df1","_id":"@curostrides/curoai@1.0.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-6C+8vOam22jzkpX/R043SFXAjvCMmDWmCmFj2ja61FKnJYVPtU0jRUzEHzncv4UFJoX4x7NGwxenrgqEeG2czQ==","shasum":"635be873cf1de63cb5da3f1f1d05bb717bb2a97e","tarball":"https://registry.npmjs.org/@curostrides/curoai/-/curoai-1.0.0.tgz","fileCount":19,"unpackedSize":21010,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAdjAbWxCVEar9k1xaMXhBI201LLaE/djp6PP4KSfdD5AiEAzvzw0e/LdBNY8tZ0SsxDIOWWtFvia10daIimdQYpNeI="}]},"_npmUser":{"name":"devnm21-cr","email":"devakumar.nm@curostrides.com"},"directories":{},"maintainers":[{"name":"devnm21-cr","email":"devakumar.nm@curostrides.com"},{"name":"samarthcurostrides","email":"samarth@curostrides.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/curoai_1.0.0_1695551189010_0.5065799208627291"},"_hasShrinkwrap":false}},"time":{"created":"2023-09-24T10:26:28.903Z","1.0.0":"2023-09-24T10:26:29.162Z","modified":"2023-09-24T10:26:29.431Z"},"maintainers":[{"name":"devnm21-cr","email":"devakumar.nm@curostrides.com"},{"name":"samarthcurostrides","email":"samarth@curostrides.com"}],"description":"CuroAI is a JavaScript library designed for interfacing with the Curo AI system, which leverages OpenAI's powerful GPT-3.5 model for chat completions and Pinecone for efficient indexing and retrieval of chat history. This library simplifies the process of","keywords":[],"author":{"name":"CuroStrides"},"license":"ISC","readme":"# CuroAI Library (GPT with long-term memory)\n\nCuroAI is a JavaScript library designed for interfacing with the Curo AI system, which leverages OpenAI's powerful GPT-3.5 model for chat completions and Pinecone for efficient indexing and retrieval of chat history. This library simplifies the process of creating conversational agents that can remember and respond to previous interactions intelligently.\n\nThis library tries to mimic a memory between the system and user beyond a conversation, or simply put a pseudo-memory.\n## Installation\n\nTo use CuroAI in your JavaScript project, you can install it using npm or yarn:\n\n```shell\nnpm install curoai\n# or\nyarn add curoai\n```\n## Initialization\n1. Import the library into your project:\n\n```javascript\nimport CuroAI from 'curoai';\n```\n2. Create an instance of the CuroAI client by providing your OpenAI API Key and Pinecone API Key:\n```javascript\n   const curoai = new CuroAI({\n    openAIAPIKey: 'YOUR_OPENAI_API_KEY',\n    pinecone: {\n    environment: 'YOUR_PINECONE_ENVIRONMENT',\n    apiKey: 'YOUR_PINECONE_API_KEY'\n    },\n   // Optionally, specify the initial OpenAI model (default: 'gpt-3.5-turbo-16k')\n    model: 'gpt-3.5-turbo-16k',\n   });\n```\n\n## Usage\n\n### Sending messages\nYou can use CuroAI to send messages in a conversation. Messages should be provided as an array of objects with a role and optional content:\n\n```javascript\nconst messages = [\n  { role: 'user', content: 'Hello, CuroAI!' },\n  { role: 'assistant', content: 'Hi there! How can I assist you?' },\n];\n\nconst user = {\n  uid: 'USER_ID', // Unique reference to the user interacting with the system\n  firstName: 'John', // User's first name\n};\n\nconst input = {\n  messages,\n  user,\n};\n\n// Get a response as a stream of chat chunks\nconst response = await curo.getCompletionStream(input);\n\n// The reponse by default is a stream\nconsole.log(response);\n```\n\n\n## Notes\n- The CuroAI library facilitates intelligent conversations by remembering and referencing previous interactions.\n- Pinecone is used to efficiently index and retrieve chat history.\n- Remember to replace 'YOUR_OPENAI_API_KEY', 'YOUR_PINECONE_ENVIRONMENT', and 'YOUR_PINECONE_API_KEY' with your actual API keys.\n- You can customize the OpenAI model used by modifying the model property during client initialization.\n\n_And, feel free to pitch in ideas on how to improve this!_\n","readmeFilename":"README.md"}