Search

178 results found for embeddings (2682ms)

Code
168

- **Supabase** with PGVector for vector search
- **OpenAI/Mistral** for AI responses
- **Hugging Face** for embeddings
### Database Schema
```sql
-- Medical content chunks with embeddings
CREATE TABLE medical_content (
id SERIAL PRIMARY KEY,
- Supabase project with PGVector extension
- OpenAI or Mistral API key
- Hugging Face API key (optional for server-side embeddings)
### Environment Variables
│ ├── routes/
│ │ ├── chat.ts # Chat API endpoints
│ │ ├── embeddings.ts # Embedding generation
│ │ └── static.ts # Static file serving
│ └── index.ts # Main API entry point
try {
// Get embedding
const embResponse = await fetch("https://api.openai.com/v1/embeddings", {
method: "POST",
headers: {
async getEmbedding(text: string, apiKey: string) {
const response = await fetch("https://api.openai.com/v1/embeddings", {
method: "POST",
headers: {
},
body: JSON.stringify({
model: "text-embedding-3-small", // IMPORTANT: Match your Pinecone embeddings
input: text,
}),
try {
// Get embedding
const embResponse = await fetch("https://api.openai.com/v1/embeddings", {
method: "POST",
headers: {
import { Pinecone } from "https://esm.sh/@pinecone-database/pinecone@2.0.0";
// Use OpenAI client only for embeddings
const openai = new OpenAI({
apiKey: Deno.env.get("OPENAI_API_KEY"),
// Get embedding for query
const embeddingResponse = await openai.embeddings.create({
model: "text-embedding-3-small",
input: query,
"slug": "val-vibes",
"link": "/blog/val-vibes",
"description": "How to build semantic search with embeddings for Val Town within Val Town it
"pubDate": "Tue, 18 Jun 2024 00:00:00 GMT",
"author": "JP Posma",
"slug": "val-vibes",
"link": "/blog/val-vibes",
"description": "How to build semantic search with embeddings for Val Town within Val Town it
"pubDate": "Tue, 18 Jun 2024 00:00:00 GMT",
"author": "JP Posma",
// Get embedding for query
const embeddingResponse = await openai.embeddings.create({
model: "text-embedding-3-small",
input: query,
"slug": "val-vibes",
"link": "/blog/val-vibes",
"description": "How to build semantic search with embeddings for Val Town within Val Town it
"pubDate": "Tue, 18 Jun 2024 00:00:00 GMT",
"author": "JP Posma",
"slug": "val-vibes",
"link": "/blog/val-vibes",
"description": "How to build semantic search with embeddings for Val Town within Val Town it
"pubDate": "Tue, 18 Jun 2024 00:00:00 GMT",
"author": "JP Posma",
peterqliu
PineconeIndex
Vector db's on Pinecone, with OpenAI embeddings
Public
tmcw
surprisingEmbeddings
Visualizing embedding distances
Public
maxm
emojiVectorEmbeddings
 
Public
janpaul123
blogPostEmbeddingsDimensionalityReduction
 
Public
janpaul123
compareEmbeddings
 
Public

Users

No users found
No docs found