![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
A.I. :D
Aid is a TypeScript library designed for developers working with Large Language Models (LLMs) such as OpenAI's GPT-4 (including Vision) and GPT-3.5. The library focuses on ensuring consistent, typed outputs from LLM queries, enhancing the reliability and usability of LLM responses. Advanced users can leverage few-shot examples for more sophisticated use cases. It provides a structured and type-safe way to interact with LLMs.
QueryEngine
function. Examplepnpm install @ai-d/aid
First, import the necessary modules and set up your OpenAI instance:
import { OpenAI } from "openai";
import { Aid } from "@ai-d/aid";
const openai = new OpenAI({ apiKey: "your-api-key" });
const aid = Aid.from(openai, { model: "gpt-4-1106-preview" });
import { OpenAI } from "openai";
import { Aid, OpenAIQuery } from "@ai-d/aid";
const openai = new OpenAI({ apiKey: "your-api-key" });
const aid = Aid.vision(
OpenAIQuery(openai, { model: "gpt-4-vision-preview", max_tokens: 2048 }),
);
For example, Cohere's Command.
import { Aid, CohereQuery } from "@ai-d/aid";
const aid = Aid.chat(
CohereQuery(COHERE_TOKEN, { model: "command" }),
);
You can implement your own
QueryEngine
function.
Define a custom task with expected output types:
import { z } from "zod";
const analyze = aid.task(
"Summarize and extract keywords",
z.object({
summary: z.string().max(300),
keywords: z.array(z.string().max(30)).max(10),
}),
);
const analyze = aid.task(
"Analyze the person in the image",
z.object({
gender: z.enum(["boy", "girl", "other"]),
age: z.enum(["child", "teen", "adult", "elderly"]),
emotion: z.enum(["happy", "sad", "angry", "surprised", "neutral"]),
clothing: z.string().max(100),
background: z.string().max(100),
}),
);
Execute the task and handle the output:
const { result } = await analyze("Your input here, e.g. a news article");
console.log(result); // { summary: "...", keywords: ["...", "..."] }
const datauri = `data:image/png;base64,${fs.readFileSync("path/to/image.png" "base64")}`;
const { result } = await analyze({ images: [{ url: datauri }] });
console.log(result); // { "gender": "boy", "age": "teen", ... }
For more complex scenarios, you can use few-shot examples:
const run_advanced_task = aid.task(
"Some Advanced Task",
z.object({
// Define your output schema here
}),
{
examples: [
// Provide few-shot examples here
],
}
);
Case Parameter -> (join) Task Defination -> (join) Format Constraint -> (perform) Query
Query
and Format Constraint
are defined and implemented by the QueryEngine
and FormatEngine
.
Task Defination
is defined by the user with task
method. Task Goal, Expected Schema, Examples, etc.
Case Parameter
is defined by the user on each single call. Text, Image, etc.
Contributions are welcome! Please submit pull requests with any bug fixes or feature enhancements.
FAQs
Aid provides a structured and type-safe way to interact with LLMs.
The npm package @ai-d/aid receives a total of 16 weekly downloads. As such, @ai-d/aid popularity was classified as not popular.
We found that @ai-d/aid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.