
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
You can install the @gel/ai
package from npm using your favorite package manager.
npm install @gel/ai
yarn add @gel/ai
pnpm add @gel/ai
See the AI documentation for detailed guidance on setting up the AI extension and creating a schema for use with the specialized indexes it includes.
The following example demonstrates how to use the @gel/ai
package to query an AI model about astronomy and chemistry.
import { createClient } from "gel";
import { createRAGClient } from "@gel/ai";
const client = createRAGClient({
instanceName: "_localdev",
database: "main",
tlsSecurity: "insecure",
});
const gpt4Rag = createRAGClient(client, {
model: "gpt-4-turbo",
});
const astronomyRag = gpt4Rag.withContext({ query: "Astronomy" });
console.time("gpt-4 Time");
console.log(await astronomyRag.queryRag({ prompt: "What color is the sky on Mars?" }));
console.timeEnd("gpt-4 Time");
const fastAstronomyRag = astronomyRag.withConfig({
model: "gpt-4o",
});
console.time("gpt-4o Time");
console.log(await fastAstronomyRag.queryRag({ prompt: "What color is the sky on Mars?" }));
console.timeEnd("gpt-4o Time");
const fastChemistryRag = fastAstronomyRag.withContext({ query: "Chemistry" });
console.log(
await fastChemistryRag.queryRag({ prompt: "What is the atomic number of gold?" }),
);
// handle the Response object
const response = await fastChemistryRag.streamRag(
{ prompt: "What is the atomic number of gold?" },
);
handleReadableStream(response); // custom function that reads the stream
// handle individual chunks as they arrive
for await (const chunk of fastChemistryRag.streamRag(
{ prompt: "What is the atomic number of gold?" },
)) {
console.log("chunk", chunk);
}
// embeddings
console.log(
await fastChemistryRag.generateEmbeddings({
inputs: ["What is the atomic number of gold?"],
model: "text-embedding-ada-002",
}),
);
FAQs
Helper library for the Gel AI extension
The npm package @gel/ai receives a total of 149 weekly downloads. As such, @gel/ai popularity was classified as not popular.
We found that @gel/ai demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.