technovangelist.videoprojects/2024-04-11-whatsinyourchroma/windowsversion.ps1
Matt Williams e42f53623a nomic embed script
Signed-off-by: Matt Williams <m@technovangelist.com>
2024-04-11 09:52:56 -07:00

22 lines
498 B
PowerShell

param (
[string]$prompt = $args -join ' '
)
# Define the API URL
$apiUrl = "http://localhost:11434/api/embeddings"
# Prepare the payload
$body = @{
model = "nomic-embed-text"
prompt = $prompt
} | ConvertTo-Json
# Send the request
$response = Invoke-RestMethod -Uri $apiUrl -Method Post -Body $body -ContentType "application/json"
# Extract the embedding and copy to clipboard
$response.embedding | Set-Clipboard
# Output a custom message
Write-Host "Embedding added to clipboard."