A code viewer with syntax highlighting, a language switcher, and a copy button.
Copy the command below and run it in your terminal.
The component depends on highlight.js. Install
it if your project doesn't have it yet:
Copy the command below and run it in your terminal.
Pass a tabs array for the multi-language form,
or code + lang for a single snippet:
From a single highlighted snippet to fully composed, multi-language blocks.
# Import the Pinecone library from pinecone import Pinecone # Initialize a Pinecone client with your API key pc = Pinecone(api_key="YOUR_API_KEY") # Create an index for dense vectors with integrated embedding index_name = "quickstart-py" pc.create_index_for_model( name=index_name, cloud="aws", region="us-east-1", embed={ "model": "llama-text-embed-v2", "field_map": {"text": "chunk_text"}, }, )// Import the Pinecone library import { Pinecone } from '@pinecone-database/pinecone' // Initialize a Pinecone client with your API key const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' }); // Create an index for dense vectors with integrated embedding const indexName = 'quickstart-js'; await pc.createIndexForModel({ name: indexName, cloud: 'aws', region: 'us-east-1', embed: { model: 'llama-text-embed-v2', fieldMap: { text: 'chunk_text' }, }, waitUntilReady: true, });// Initialize a Pinecone client with your API key import io.pinecone.clients.Pinecone; import org.openapitools.db_control.client.model.*; Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build(); // Create an index for dense vectors with integrated embedding String indexName = "quickstart-java"; pc.createIndexForModel( indexName, CreateIndexForModelRequest.CloudEnum.AWS, "us-east-1", new CreateIndexForModelRequestEmbed() .model("llama-text-embed-v2") .fieldMap(Map.of("text", "chunk_text")), DeletionProtection.DISABLED, null );// Initialize a Pinecone client with your API key import "github.com/pinecone-io/go-pinecone/v3/pinecone" pc, err := pinecone.NewClient(pinecone.NewClientParams{ ApiKey: "YOUR_API_KEY", }) // Create an index for dense vectors with integrated embedding indexName := "quickstart-go" index, err := pc.CreateIndexForModel(ctx, &pinecone.CreateIndexForModelRequest{ Name: indexName, Cloud: pinecone.Aws, Region: "us-east-1", Embed: pinecone.CreateIndexForModelEmbed{ Model: "llama-text-embed-v2", FieldMap: map[string]interface{}{"text": "chunk_text"}, }, })// Initialize a Pinecone client with your API key using Pinecone; var pc = new PineconeClient("YOUR_API_KEY"); // Create an index for dense vectors with integrated embedding var indexName = "quickstart-cs"; var index = await pc.CreateIndexForModelAsync(new CreateIndexForModelRequest { Name = indexName, Cloud = CreateIndexForModelRequestCloud.Aws, Region = "us-east-1", Embed = new CreateIndexForModelRequestEmbed { Model = "llama-text-embed-v2", FieldMap = new Dictionary<string, object?> { { "text", "chunk_text" } }, }, });