Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A React component for adding GPT-4 powered search using the Markprompt API.
A headless React component for building a prompt interface, based on the Markprompt API.
Check out the starter template for a fully working example: Markprompt starter template.
In Motif, paste the following import statement in an MDX, JSX or TSX file:
import { Markprompt } from 'https://esm.sh/markprompt';
If you have a Node-based setup, install the markprompt
package via npm or yarn:
# npm
npm install markprompt
# Yarn
yarn add markprompt
Example:
import { Markprompt } from 'markprompt';
function MyPrompt() {
return <Markprompt projectKey="<project-key>" model="gpt-4" />;
}
where project-key
can be obtained in your project settings, and model
is the identifier of the OpenAI model to use for completions. Supported models are:
gpt-4
gpt-4-0314
gpt-4-32k
gpt-4-32k-0314
gpt-3.5-turbo
gpt-3.5-turbo-0301
text-davinci-003
, text-davinci-002
, text-curie-001
, text-babbage-001
, text-ada-001
, davinci
, curie
, babbage
, ada
If no model is specified, gpt-3.5-turbo
will be used.
The Markprompt component is styled using Tailwind CSS, and therefore requires a working Tailwind configuration. We are planning to make it headless, for more flexible options.
You can pass the following props to the component:
Prop | Default value | Description |
---|---|---|
projectKey | Your project's API key, found in the project settings. | |
model | gpt-3.5-turbo | The OpenAI completions model to use. Supported values: gpt-4 , gpt-4-0314 , gpt-4-32k , gpt-4-32k-0314 , gpt-3.5-turbo , gpt-3.5-turbo-0301 , text-davinci-003 , text-davinci-002 , text-curie-001 , text-babbage-001 , text-ada-001 , davinci , curie , babbage , ada |
settings. | ||
iDontKnowMessage | Sorry, I am not sure how to answer that. | Fallback message in can no answer is found. |
placeholder | Ask me anything... | Message to show in the input box when no text has been entered. |
Example:
<Markprompt
projectKey="..."
model="..."
iDontKnowMessage="Sorry, I don't know!"
placeholder="Ask Acme docs..."
/>
Usage of the Markprompt API is subject to quotas, depending on the plan you have subscribed to. Markprompt has systems in place to detect abuse and excessive usage, but we nevertheless recommend being cautious when offering a prompt interface on a public website. In any case, when using the production project key, the prompt will only work on domains you have whitelisted through the Markprompt dashboard.
When developing locally, for instance on localhost, use the development test key instead. This allows you to access the API from a non-whitelisted domain. For that reason, make sure to keep this key private.
For a fully working setup based on Next.js + Tailwind, check out the Markprompt starter template.
This library is created by the team behind Motif (@motifland).
MIT
FAQs
A React component for adding GPT-4 powered search using the Markprompt API.
We found that markprompt 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.