Search

174 results found for embeddings (5317ms)

Code
165

* Initialize the embedding model
*/
async function initEmbeddings(modelId = EMBEDDING_MODELS.fast) {
if (embedder && embedder.model?.config?.name_or_path === modelId) {
return embedder;
async function processAllFeeds() {
await initDatabase();
await initEmbeddings();
let totalProcessed = 0;
"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",
const {model, modelToken} = this.options;
const response = await axios.post(
"https://api.openai.com/v1/embeddings",
{model, input: text },
{
"link": "/blog/val-vibes",
"description":
"How to build semantic search with embeddings for Val Town within Val Town itself",
"pubDate": "Tue, 18 Jun 2024 00:00:00 GMT",
"author": "JP Posma",
rups/ai/README.md
2 matches
```
async function calculateEmbeddings(text) {
const url = `https://yawnxyz-ai.web.val.run/generate?embed=true&value=${encodeURIComponent(t
return data;
} catch (error) {
console.error('Error calculating embeddings:', error);
return null;
}
// Embedding endpoints
async generateEmbedding(request: EmbeddingRequest): Promise<ApiResponse<EmbeddingResponse>> {
return this.request<EmbeddingResponse>('/embeddings/generate', {
method: 'POST',
body: JSON.stringify(request),
threshold?: number;
}): Promise<ApiResponse<any>> {
return this.request('/embeddings/search', {
method: 'POST',
body: JSON.stringify(query),
}
async embeddingsHealthCheck(): Promise<ApiResponse<any>> {
return this.request('/embeddings/health');
}
const API_CACHE_PATTERNS = [
/\/api\/health/,
/\/api\/embeddings\/health/,
/\/api\/chat\/health/
];
import { initializeDatabase } from './services/supabase.ts';
import chatRoutes from './routes/chat.ts';
import embeddingRoutes from './routes/embeddings.ts';
const app = new Hono();
// API Routes
app.route('/api/chat', chatRoutes);
app.route('/api/embeddings', embeddingRoutes);
// Health check
import { Hono } from 'https://esm.sh/hono@3.11.7';
import { generateEmbedding, generateEmbeddings } from '../services/embeddings.ts';
import { searchSimilarContent } from '../services/supabase.ts';
import type { EmbeddingRequest, EmbeddingResponse } from '../../shared/types.ts';
const embeddings = new Hono();
// Generate embedding for a single text
embeddings.post('/generate', async (c) => {
try {
const body: EmbeddingRequest = await c.req.json();
});
// Generate embeddings for multiple texts
embeddings.post('/batch', async (c) => {
try {
const body: { texts: string[] } = await c.req.json();
}
const embeddings = await generateEmbeddings(texts);
return c.json({
embeddings,
count: embeddings.length,
dimensions: embeddings[0]?.length || 0
});
console.error('Batch embedding generation error:', error);
return c.json({
error: 'Failed to generate batch embeddings',
details: error.message
}, 500);
// Search similar content using embedding
embeddings.post('/search', async (c) => {
try {
const body: {
// Health check endpoint
embeddings.get('/health', (c) => {
return c.json({
status: 'healthy',
service: 'nelson-gpt-embeddings',
timestamp: new Date().toISOString()
});
});
export default embeddings;
import { Hono } from 'https://esm.sh/hono@3.11.7';
import { streamSSE } from 'https://esm.sh/hono@3.11.7/streaming';
import { generateEmbedding } from '../services/embeddings.ts';
import { searchSimilarContent } from '../services/supabase.ts';
import { generateMistralResponse, streamMistralResponse } from '../services/mistral.ts';
tmcw
surprisingEmbeddings
Visualizing embedding distances
Public
maxm
emojiVectorEmbeddings
 
Public
janpaul123
blogPostEmbeddingsDimensionalityReduction
 
Public
janpaul123
compareEmbeddings
 
Public
yawnxyz
embeddingsSearchExample
 
Public

Users

No users found
No docs found