New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@7-docs/edge

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@7-docs/edge

Package to use 7-docs from edge functions

  • 0.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19
increased by35.71%
Maintainers
1
Weekly downloads
 
Created
Source

@7-docs/edge

Use 7-docs from edge functions.

After ingesting content using 7-docs, it can be queried from web or the command-line interface.

Usage

import { createClient } from 'https://esm.sh/@supabase/supabase-js@2.20.0';
import { getCompletionHandler } from '@7-docs/edge';
import * as supabase from '@7-docs/edge/supabase';

const namespace = 'table-in-supabase';

const prompt = `Answer the question using the provided context.
Context: {CONTEXT}
Question: {QUERY}
Answer:`;

const client = createClient(SUPABASE_URL, SUPABASE_API_KEY);
const query = (vector: number[]) => supabase.query({ client, namespace, vector });

const handler = getCompletionHandler({ OPENAI_API_KEY, query, prompt });

export default function (req: Request) {
  return handler(req);
}

Edge + UI example using (P)react

See github.com/7-docs/demo-react for a full example.

CLI

To query the content from the CLI, 7-docs includes the 7d executable to do this.

FAQs

Package last updated on 20 Apr 2023

Did you know?

Socket

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.

Install

Related posts

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