Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@markprompt/web

Package Overview
Dependencies
Maintainers
1
Versions
223
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@markprompt/web - npm Package Compare versions

Comparing version 0.4.1 to 0.5.0

2

dist/index.d.ts
import { type MarkpromptOptions } from './types.js';
/**
* Render a markprompt dialog button.
*
* @param projectKey Your Markprompt project key

@@ -4,0 +6,0 @@ * @param container The element or selector to render Markprompt into

@@ -1,3 +0,4 @@

import { type Options as CoreOptions } from '@markprompt/core';
type MarkpromptOptions = CoreOptions & {
import { type SubmitPromptOptions } from '@markprompt/core';
import type { FlattenedSearchResult } from '@markprompt/react';
type MarkpromptOptions = SubmitPromptOptions & {
close?: {

@@ -21,6 +22,15 @@ /**

};
search?: {
/**
* Enable search
* @default false
**/
enable?: boolean;
/** Callback to transform a search result into an href */
getResultHref?: (result: FlattenedSearchResult) => string;
};
prompt?: {
/**
* Label for the prompt input
* @default "Your prompt"
* @default "Ask me anything…"
**/

@@ -27,0 +37,0 @@ label?: string;

13

package.json
{
"name": "@markprompt/web",
"version": "0.4.1",
"version": "0.5.0",
"description": "A web component for adding GPT-4 powered search using the Markprompt API.",

@@ -11,3 +11,3 @@ "repository": {

"license": "MIT",
"author": "Motif",
"author": "Markprompt",
"type": "module",

@@ -32,6 +32,11 @@ "exports": {

"dependencies": {
"@markprompt/core": "0.4.6"
"@markprompt/core": "0.5.0",
"@react-spring/web": "^9.7.2",
"clsx": "^1.2.1",
"react-simple-animate": "^3.5.2",
"transition-hook": "^1.5.2",
"use-presence": "^1.2.0"
},
"devDependencies": {
"@markprompt/react": "0.4.0",
"@markprompt/react": "0.5.0",
"@radix-ui/react-accessible-icon": "^1.0.3",

@@ -38,0 +43,0 @@ "@types/react": "^18.2.6",

@@ -13,4 +13,21 @@ # `@markprompt/web`

</a>
<a aria-label="Coverage" href="https://app.codecov.io/gh/motifland/markprompt-js/tree/main/packages%2Fweb">
<img alt="" src="https://codecov.io/gh/motifland/markprompt-js/branch/main/graph/badge.svg" />
</a>
</p>
## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Usage via `<script>` tag](#usage-via-script-tag)
- [API](#api)
- [`markprompt(projectKey, container, options?)`](#markpromptprojectkey-container-options)
- [Arguments](#arguments)
- [Options](#options)
- [Documentation](#documentation)
- [Community](#community)
- [Authors](#authors)
- [License](#license)
## Installation

@@ -30,3 +47,3 @@

<!-- load from a CDN: -->
<link rel="stylesheet" href="https://esm.sh/@markprompt/css?css" />
<link rel="stylesheet" href="https://esm.sh/@markprompt/css@0.1.1?css" />
```

@@ -57,3 +74,3 @@

Options are optional and allow you to configure texts the component to some extent. You will most likely want to pass `transformReferenceId` to transform your reference ids into links to your corresponding documentation.
Options are optional and allow you to configure the texts used in the component to some extent. You will most likely want to pass `transformReferenceId` to transform your reference ids into links to your corresponding documentation.

@@ -76,3 +93,3 @@ ```ts

prompt?: {
/** Label for the prompt input, default: `Your prompt` */
/** Label for the prompt input, default: `Ask me anything…` */
label?: string;

@@ -93,2 +110,8 @@ /** Placeholder for the prompt input, default: `Ask me anything…` */

};
search?: {
/** Enable search **/
enable?: boolean;
/** Callback to transform a search result into an href */
getResultHref?: (result: FlattenedSearchResult) => string;
};
/** Props for the trigger */

@@ -118,3 +141,3 @@ trigger?: {

rel="stylesheet"
href="https://unpkg.com/@markprompt/css@0.1.0/markprompt.css"
href="https://unpkg.com/@markprompt/css@0.1.1/markprompt.css"
/>

@@ -141,2 +164,41 @@ <script>

## API
### `markprompt(projectKey, container, options?)`
Render a Markprompt dialog button.
#### Arguments
- `projectKey` (`string`): Your Markprompt project key.
- `container` (`HTMLElement | string`): The element or selector to render Markprompt into.
- `options` (`object`): Options for customizing Markprompt.
#### Options
- `completionsUrl` (`string`): URL at which to fetch completions
- `iDontKnowMessage` (`string`): Message returned when the model does not have an answer
- `model` (`OpenAIModelId`): The OpenAI model to use
- `promptTemplate` (`string`): The prompt template
- `temperature` (`number`): The model temperature
- `topP` (`number`): The model top P
- `frequencyPenalty` (`number`): The model frequency penalty
- `presencePenalty` (`number`): The model present penalty
- `maxTokens` (`number`): The max number of tokens to include in the response
- `sectionsMatchCount` (`number`): The number of sections to include in the prompt context
- `sectionsMatchThreshold` (`number`): The similarity threshold between the input question and selected sections
- `signal` (`AbortSignal`): AbortController signal
- `close.label` (`string`): `aria-label` for the close modal button. (Default: `"Close Markprompt"`)
- `decription.hide` (`boolean`): Visually hide the description. (Default `true`)
- `decription.text` (`string`): Description text.
- `prompt.label` )`string`): Label for the prompt input. (Default `"Your prompt"`)
- `prompt.placeholder` )`string`): Placeholder for the prompt input. (Default `"Ask me anything…"`)
- `references.transformReferenceId` (`Function`): Callback to transform a reference id into an href and text.
- `references.loadingText` (`string`) Loading text. (Default: `Fetching relevant pages…`)
- `references.referencesText` (`string`): References title. (Default: `"Answer generated from the following sources:"`)
- `trigger.label` (`string`): `aria-label` for the open button. (Default: `"Open Markprompt"`)
- `title.hide` (`boolean`): Visually hide the title. (Default: `true`)
- `title.text` (`string`): Text for the title. (Default: `"Ask me anything"`)
- `showBranding` (`boolean`): Show Markprompt branding. (Default: `true`)
## Documentation

@@ -149,3 +211,2 @@

- [Twitter @markprompt](https://twitter.com/markprompt)
- [Twitter @motifland](https://twitter.com/motifland)
- [Discord](https://discord.gg/MBMh4apz6X)

@@ -155,3 +216,7 @@

This library is created by the team behind [Motif](https://motif.land)
([@motifland](https://twitter.com/motifland)).
This library is created by the team behind [Markprompt](https://markprompt.com)
([@markprompt](https://twitter.com/markprompt)).
## License
[MIT](./LICENSE) © [Motif](https://motif.land)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc