Polyglot \ Internals
Configuration Layer
Polyglot \ Internals
Configuration Layer
Understanding the configuration layer of Polyglot for LLM and Embeddings.
Polyglot’s configuration layer manages settings for different providers.
LLM Configuration
namespace Cognesy\Polyglot\LLM\Data;
class LLMConfig {
public function __construct(
public string $apiUrl = '',
public string $apiKey = '',
public string $endpoint = '',
public array $queryParams = [],
public array $metadata = [],
public string $model = '',
public int $maxTokens = 1024,
public int $contextLength = 8000,
public int $maxOutputLength = 4096,
public string $httpClient = '',
public string $providerType = LLMProviderType::OpenAICompatible->value
) { ... }
public static function load(string $connection): LLMConfig { ... }
}
Embeddings Configuration
namespace Cognesy\Polyglot\Embeddings\Data;
class EmbeddingsConfig {
public function __construct(
public string $apiUrl = '',
public string $apiKey = '',
public string $endpoint = '',
public string $model = '',
public int $dimensions = 0,
public int $maxInputs = 0,
public array $metadata = [],
public string $httpClient = '',
public string $providerType = LLMProviderType::OpenAI->value
) { ... }
public static function load(string $connection): EmbeddingsConfig { ... }
}
On this page