Chunk #640

Aus: AI-Services (Index: 5)

112 Tokens
Synced Status
« Vorheriger (#4) Nächster (#6) »

Taxonomie

Kategorie AI-Services
Pfad AI-Services > OllamaService > Embedding/Generation
Heading-Pfad AI-Services > AI Services > OllamaService > Code-Beispiel

Entities

Name Typ
OllamaService SERVICE
Ollama TECHNOLOGY
Embedding CONCEPT
Text Generation CONCEPT
Health Check COMMAND

Keywords

Ollama Embedding Generation Health Check API

Inhalt

use Infrastructure\AI\OllamaService;

$ollama = new OllamaService('http://localhost:11434');

// Embedding erstellen
$embedding = $ollama->getEmbedding('Hello World');
// Returns: [0.123, -0.456, 0.789, ...] (1024 floats)

// Text generieren
$response = $ollama->generate('Explain quantum computing.');
// Returns: "Quantum computing is a type of computing that..."

// Health Check
if ($ollama->isAvailable()) {
    echo "Ollama läuft";
}

Clean Content

```
`use Infrastructure\AI\OllamaService;

$ollama = new OllamaService('http://localhost:11434');

// Embedding erstellen
$embedding = $ollama->getEmbedding('Hello World');
// Returns: [0.123, -0.456, 0.789, ...] (1024 floats)

// Text generieren
$response = $ollama->generate('Explain quantum computing.');
// Returns: "Quantum computing is a type of computing that..."

// Health Check
if ($ollama->isAvailable()) {
 echo "Ollama läuft";
}`
```

Metadaten

Analysiert am20.12.2025 12:48:30
Analyse-Modellgemma3:4b-it-qat
Embedding-Modellmxbai-embed-large
Qdrant-IDd3c7c9e6-ca98-4fb4-91e8-73b6f604fdc0
Erstellt20.12.2025 12:34:42
Aktualisiert20.12.2025 12:53:41