![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.
format-gpt2
Advanced tools
FormatGPT is a robust library designed to sanitize output provided by ChatGPT. It provides a consistent and well defined method for retrieving the data from ChatGPT by acting as a middle man between your code and ChatGPT API. It supports various formats such as:
Additionally each output format can be easily customized to suit your needs.
To install the library using npm
run the command:
npm install format-gpt
To install the library using yarn
run the command:
yarn add format-gpt
Here's a quick example to get you started:
import formatGPT from "format-gpt";
formatGpt.format({
format: "json",
options: {
attributes: [
{ name: "name", type: "string" },
{ name: "description", type: "string", maxLength: 200 },
{ name: "released", type: "date" },
{ name: "price", type: "decimal" }
]
},
language: "en"
});
The default export is formatChatGptPrompt
.
formatChatGptPrompt({
prompt: string,
format: Format,
options?: FormatOptions,
language?: string
}): string;
prompt (string)
- content of the prompt for chat-gptformat (Format)
- format in which to return output from chat-gptoptions (FormatOptions)
attributes: (IAttribute[])
- array with attribute definitionscolumnSeparator (string)
- column separator (for CSV format, default: ",")rowSeparator (string)
- row separator (for CSV format. default: \n)language (string)
- language code (example: en, pl)formatChatGptMessages({
messages: ChatCompletionRequestMessage[],
format: Format,
options?: FormatOptions,
language?: string
}): ChatCompletionRequestMessage[];
messages (ChatCompletionRequestMessage[])
- messages sent to chat-gpt apiformat (Format)
- format in which to return output from chat-gptoptions (FormatOptions)
attributes: (IAttribute[])
- array with attribute definitionscolumnSeparator (string)
- column separator (for CSV format, default: ",")rowSeparator (string)
- row separator (for CSV format. default: \n)language (string)
- language code (example: en, pl)formatChatGptRequest({
request: CreateChatCompletionRequest,
format: Format,
options?: FormatOptions,
language?: string
}): CreateChatCompletionRequest;
request (CreateChatCompletionRequest)
- request config for chat-gpt apiformat (Format)
- format in which to return output from chat-gptoptions (FormatOptions)
attributes: (IAttribute[])
- array with attribute definitionscolumnSeparator (string)
- column separator (for CSV format, default: ",")rowSeparator (string)
- row separator (for CSV format. default: \n)language (string)
- language code (example: en, pl)
type Format = "array" | "csv" | "html" | "json" | "json-list" | "markdown" | "table" | "text" | "xml" | "yaml";
interface IAttribute {
name: string;
type: "string" | "number" | "boolean" | "date" | "integer" | "decimal" | Array<IAttribute>;
minLength?: number;
maxLength?: number;
custom?: string;
}
For more information on ChatCompletionRequestMessage
and CreateChatCompletionRequest
please refer OpenAI documentation.
To build format-gpt follow these steps:
npm install
or yarn install
commandyarn
with Visual Studio Code also run yarn dlx @yarnpkg/sdks vscode
npm build
or yarn build
commandTo run the test suite, first install the dependencies, then execute tests.
Using npm
:
npm install
npm test
Using yarn
:
yarn install
yarn test
This project is licensed under the MIT License.
FAQs
ChatGPT output formatter.
The npm package format-gpt2 receives a total of 0 weekly downloads. As such, format-gpt2 popularity was classified as not popular.
We found that format-gpt2 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.