diff --git a/src/AiClient.php b/src/AiClient.php index 80ffbd62..67bf36c8 100644 --- a/src/AiClient.php +++ b/src/AiClient.php @@ -74,7 +74,7 @@ * ->generateTextResult(); * ``` * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-import-type Prompt from PromptBuilder * @@ -90,7 +90,7 @@ class AiClient /** * Gets the default provider registry instance. * - * @since n.e.x.t + * @since 0.1.0 * * @return ProviderRegistry The default provider registry. */ @@ -114,7 +114,7 @@ public static function defaultRegistry(): ProviderRegistry /** * Checks if a provider is configured and available for use. * - * @since n.e.x.t + * @since 0.1.0 * * @param ProviderAvailabilityInterface $availability The provider availability instance to check. * @return bool True if the provider is configured and available, false otherwise. @@ -131,7 +131,7 @@ public static function isConfigured(ProviderAvailabilityInterface $availability) * The traditional API methods in this class delegate to PromptBuilder * for all generation logic. * - * @since n.e.x.t + * @since 0.1.0 * * @param Prompt $prompt Optional initial prompt content. * @param ProviderRegistry|null $registry Optional custom registry. If null, uses default. @@ -149,7 +149,7 @@ public static function prompt($prompt = null, ?ProviderRegistry $registry = null * model discovery based on prompt content and configuration. When a model is provided, * it infers the capability from the model's interfaces and delegates to the capability-based method. * - * @since n.e.x.t + * @since 0.1.0 * * @param Prompt $prompt The prompt content. * @param ModelInterface|ModelConfig $modelOrConfig Specific model to use, or model configuration @@ -172,7 +172,7 @@ public static function generateResult( /** * Generates text using the traditional API approach. * - * @since n.e.x.t + * @since 0.1.0 * * @param Prompt $prompt The prompt content. * @param ModelInterface|ModelConfig|null $modelOrConfig Optional specific model to use, @@ -197,7 +197,7 @@ public static function generateTextResult( /** * Generates an image using the traditional API approach. * - * @since n.e.x.t + * @since 0.1.0 * * @param Prompt $prompt The prompt content. * @param ModelInterface|ModelConfig|null $modelOrConfig Optional specific model to use, @@ -221,7 +221,7 @@ public static function generateImageResult( /** * Converts text to speech using the traditional API approach. * - * @since n.e.x.t + * @since 0.1.0 * * @param Prompt $prompt The prompt content. * @param ModelInterface|ModelConfig|null $modelOrConfig Optional specific model to use, @@ -245,7 +245,7 @@ public static function convertTextToSpeechResult( /** * Generates speech using the traditional API approach. * - * @since n.e.x.t + * @since 0.1.0 * * @param Prompt $prompt The prompt content. * @param ModelInterface|ModelConfig|null $modelOrConfig Optional specific model to use, @@ -273,7 +273,7 @@ public static function generateSpeechResult( * MessageBuilder will provide a fluent interface for constructing complex * messages with multiple parts, attachments, and metadata. * - * @since n.e.x.t + * @since 0.1.0 * * @param string|null $text Optional initial message text. * @return object MessageBuilder instance (type will be updated when MessageBuilder is available). diff --git a/src/Builders/PromptBuilder.php b/src/Builders/PromptBuilder.php index 57b1047c..42dbe085 100644 --- a/src/Builders/PromptBuilder.php +++ b/src/Builders/PromptBuilder.php @@ -36,7 +36,7 @@ * content types and model configurations. It automatically infers model * requirements based on the features used in the prompt. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-import-type MessageArrayShape from Message * @phpstan-import-type MessagePartArrayShape from MessagePart @@ -74,7 +74,7 @@ class PromptBuilder /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param ProviderRegistry $registry The provider registry for finding suitable models. * @param Prompt $prompt Optional initial prompt content. @@ -103,7 +103,7 @@ public function __construct(ProviderRegistry $registry, $prompt = null) /** * Adds text to the current message. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $text The text to add. * @return self @@ -125,7 +125,7 @@ public function withText(string $text): self * - Data URI string (data:mime/type;base64,data) * - Local file path string * - * @since n.e.x.t + * @since 0.1.0 * * @param string|File $file The file (File object or string representation). * @param string|null $mimeType The MIME type (optional, ignored if File object provided). @@ -144,7 +144,7 @@ public function withFile($file, ?string $mimeType = null): self /** * Adds a function response to the current message. * - * @since n.e.x.t + * @since 0.1.0 * * @param FunctionResponse $functionResponse The function response. * @return self @@ -159,7 +159,7 @@ public function withFunctionResponse(FunctionResponse $functionResponse): self /** * Adds message parts to the current message. * - * @since n.e.x.t + * @since 0.1.0 * * @param MessagePart ...$parts The message parts to add. * @return self @@ -178,7 +178,7 @@ public function withMessageParts(MessagePart ...$parts): self * Historical messages are prepended to the beginning of the message list, * before the current message being built. * - * @since n.e.x.t + * @since 0.1.0 * * @param Message ...$messages The messages to add to history. * @return self @@ -197,7 +197,7 @@ public function withHistory(Message ...$messages): self * The model's configuration will be merged with the builder's configuration, * with the builder's configuration taking precedence for any overlapping settings. * - * @since n.e.x.t + * @since 0.1.0 * * @param ModelInterface $model The model to use. * @return self @@ -222,7 +222,7 @@ public function usingModel(ModelInterface $model): self * Merges the provided configuration with the builder's configuration, * with builder configuration taking precedence. * - * @since n.e.x.t + * @since 0.1.0 * * @param ModelConfig $config The model configuration to merge. * @return self @@ -245,7 +245,7 @@ public function usingModelConfig(ModelConfig $config): self /** * Sets the provider to use for generation. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $providerIdOrClassName The provider ID or class name. * @return self @@ -262,7 +262,7 @@ public function usingProvider(string $providerIdOrClassName): self * System instructions are stored in the model configuration and guide * the AI model's behavior throughout the conversation. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $systemInstruction The system instruction text. * @return self @@ -276,7 +276,7 @@ public function usingSystemInstruction(string $systemInstruction): self /** * Sets the maximum number of tokens to generate. * - * @since n.e.x.t + * @since 0.1.0 * * @param int $maxTokens The maximum number of tokens. * @return self @@ -290,7 +290,7 @@ public function usingMaxTokens(int $maxTokens): self /** * Sets the temperature for generation. * - * @since n.e.x.t + * @since 0.1.0 * * @param float $temperature The temperature value. * @return self @@ -304,7 +304,7 @@ public function usingTemperature(float $temperature): self /** * Sets the top-p value for generation. * - * @since n.e.x.t + * @since 0.1.0 * * @param float $topP The top-p value. * @return self @@ -318,7 +318,7 @@ public function usingTopP(float $topP): self /** * Sets the top-k value for generation. * - * @since n.e.x.t + * @since 0.1.0 * * @param int $topK The top-k value. * @return self @@ -332,7 +332,7 @@ public function usingTopK(int $topK): self /** * Sets stop sequences for generation. * - * @since n.e.x.t + * @since 0.1.0 * * @param string ...$stopSequences The stop sequences. * @return self @@ -346,7 +346,7 @@ public function usingStopSequences(string ...$stopSequences): self /** * Sets the number of candidates to generate. * - * @since n.e.x.t + * @since 0.1.0 * * @param int $candidateCount The number of candidates. * @return self @@ -360,7 +360,7 @@ public function usingCandidateCount(int $candidateCount): self /** * Sets the function declarations available to the model. * - * @since n.e.x.t + * @since 0.1.0 * * @param FunctionDeclaration ...$functionDeclarations The function declarations. * @return self @@ -374,7 +374,7 @@ public function usingFunctionDeclarations(FunctionDeclaration ...$functionDeclar /** * Sets the presence penalty for generation. * - * @since n.e.x.t + * @since 0.1.0 * * @param float $presencePenalty The presence penalty value. * @return self @@ -388,7 +388,7 @@ public function usingPresencePenalty(float $presencePenalty): self /** * Sets the frequency penalty for generation. * - * @since n.e.x.t + * @since 0.1.0 * * @param float $frequencyPenalty The frequency penalty value. * @return self @@ -402,7 +402,7 @@ public function usingFrequencyPenalty(float $frequencyPenalty): self /** * Sets the web search configuration. * - * @since n.e.x.t + * @since 0.1.0 * * @param WebSearch $webSearch The web search configuration. * @return self @@ -419,7 +419,7 @@ public function usingWebSearch(WebSearch $webSearch): self * If $topLogprobs is null, enables log probabilities. * If $topLogprobs has a value, enables log probabilities and sets the number of top log probabilities to return. * - * @since n.e.x.t + * @since 0.1.0 * * @param int|null $topLogprobs The number of top log probabilities to return, or null to enable log probabilities. * @return self @@ -440,7 +440,7 @@ public function usingTopLogprobs(?int $topLogprobs = null): self /** * Sets the output MIME type. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $mimeType The MIME type. * @return self @@ -454,7 +454,7 @@ public function asOutputMimeType(string $mimeType): self /** * Sets the output schema. * - * @since n.e.x.t + * @since 0.1.0 * * @param array $schema The output schema. * @return self @@ -468,7 +468,7 @@ public function asOutputSchema(array $schema): self /** * Sets the output modalities. * - * @since n.e.x.t + * @since 0.1.0 * * @param ModalityEnum ...$modalities The output modalities. * @return self @@ -482,7 +482,7 @@ public function asOutputModalities(ModalityEnum ...$modalities): self /** * Sets the output file type. * - * @since n.e.x.t + * @since 0.1.0 * * @param FileTypeEnum $fileType The output file type. * @return self @@ -496,7 +496,7 @@ public function asOutputFileType(FileTypeEnum $fileType): self /** * Configures the prompt for JSON response output. * - * @since n.e.x.t + * @since 0.1.0 * * @param array|null $schema Optional JSON schema. * @return self @@ -513,7 +513,7 @@ public function asJsonResponse(?array $schema = null): self /** * Gets the inferred model requirements based on prompt features. * - * @since n.e.x.t + * @since 0.1.0 * * @param CapabilityEnum $capability The capability the model must support. * @return ModelRequirements The inferred requirements. @@ -587,7 +587,7 @@ private function getModelRequirements(CapabilityEnum $capability): ModelRequirem /** * Infers the capability from configured output modalities. * - * @since n.e.x.t + * @since 0.1.0 * * @return CapabilityEnum The inferred capability. * @throws RuntimeException If the output modality is not supported. @@ -630,7 +630,7 @@ private function inferCapabilityFromOutputModalities(): CapabilityEnum /** * Infers the capability from a model's implemented interfaces. * - * @since n.e.x.t + * @since 0.1.0 * * @param ModelInterface $model The model to infer capability from. * @return CapabilityEnum|null The inferred capability, or null if none can be inferred. @@ -658,7 +658,7 @@ private function inferCapabilityFromModelInterfaces(ModelInterface $model): ?Cap /** * Checks if the current prompt is supported by the selected model. * - * @since n.e.x.t + * @since 0.1.0 * * @param CapabilityEnum|null $intendedCapability Optional capability to check support for. * @return bool True if supported, false otherwise. @@ -691,7 +691,7 @@ private function isSupported(?CapabilityEnum $intendedCapability = null): bool /** * Checks if the prompt is supported for text generation. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if text generation is supported. */ @@ -703,7 +703,7 @@ public function isSupportedForTextGeneration(): bool /** * Checks if the prompt is supported for image generation. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if image generation is supported. */ @@ -715,7 +715,7 @@ public function isSupportedForImageGeneration(): bool /** * Checks if the prompt is supported for text to speech conversion. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if text to speech conversion is supported. */ @@ -727,7 +727,7 @@ public function isSupportedForTextToSpeechConversion(): bool /** * Checks if the prompt is supported for video generation. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if video generation is supported. */ @@ -739,7 +739,7 @@ public function isSupportedForVideoGeneration(): bool /** * Checks if the prompt is supported for speech generation. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if speech generation is supported. */ @@ -751,7 +751,7 @@ public function isSupportedForSpeechGeneration(): bool /** * Checks if the prompt is supported for music generation. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if music generation is supported. */ @@ -763,7 +763,7 @@ public function isSupportedForMusicGeneration(): bool /** * Checks if the prompt is supported for embedding generation. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if embedding generation is supported. */ @@ -779,7 +779,7 @@ public function isSupportedForEmbeddingGeneration(): bool * potentially multiple candidates) based on the specified capability or * the configured output modality. * - * @since n.e.x.t + * @since 0.1.0 * * @param CapabilityEnum|null $capability Optional capability to use for generation. * If null, capability is inferred from output modality. @@ -872,7 +872,7 @@ public function generateResult(?CapabilityEnum $capability = null): GenerativeAi /** * Generates a text result from the prompt. * - * @since n.e.x.t + * @since 0.1.0 * * @return GenerativeAiResult The generated result containing text candidates. * @throws InvalidArgumentException If the prompt or model validation fails. @@ -890,7 +890,7 @@ public function generateTextResult(): GenerativeAiResult /** * Generates an image result from the prompt. * - * @since n.e.x.t + * @since 0.1.0 * * @return GenerativeAiResult The generated result containing image candidates. * @throws InvalidArgumentException If the prompt or model validation fails. @@ -908,7 +908,7 @@ public function generateImageResult(): GenerativeAiResult /** * Generates a speech result from the prompt. * - * @since n.e.x.t + * @since 0.1.0 * * @return GenerativeAiResult The generated result containing speech audio candidates. * @throws InvalidArgumentException If the prompt or model validation fails. @@ -926,7 +926,7 @@ public function generateSpeechResult(): GenerativeAiResult /** * Converts text to speech and returns the result. * - * @since n.e.x.t + * @since 0.1.0 * * @return GenerativeAiResult The generated result containing speech audio candidates. * @throws InvalidArgumentException If the prompt or model validation fails. @@ -944,7 +944,7 @@ public function convertTextToSpeechResult(): GenerativeAiResult /** * Generates text from the prompt. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The generated text. * @throws InvalidArgumentException If the prompt or model validation fails. @@ -957,7 +957,7 @@ public function generateText(): string /** * Generates multiple text candidates from the prompt. * - * @since n.e.x.t + * @since 0.1.0 * * @param int|null $candidateCount The number of candidates to generate. * @return list The generated texts. @@ -976,7 +976,7 @@ public function generateTexts(?int $candidateCount = null): array /** * Generates an image from the prompt. * - * @since n.e.x.t + * @since 0.1.0 * * @return File The generated image file. * @throws InvalidArgumentException If the prompt or model validation fails. @@ -990,7 +990,7 @@ public function generateImage(): File /** * Generates multiple images from the prompt. * - * @since n.e.x.t + * @since 0.1.0 * * @param int|null $candidateCount The number of images to generate. * @return list The generated image files. @@ -1009,7 +1009,7 @@ public function generateImages(?int $candidateCount = null): array /** * Converts text to speech. * - * @since n.e.x.t + * @since 0.1.0 * * @return File The generated speech audio file. * @throws InvalidArgumentException If the prompt or model validation fails. @@ -1023,7 +1023,7 @@ public function convertTextToSpeech(): File /** * Converts text to multiple speech outputs. * - * @since n.e.x.t + * @since 0.1.0 * * @param int|null $candidateCount The number of speech outputs to generate. * @return list The generated speech audio files. @@ -1042,7 +1042,7 @@ public function convertTextToSpeeches(?int $candidateCount = null): array /** * Generates speech from the prompt. * - * @since n.e.x.t + * @since 0.1.0 * * @return File The generated speech audio file. * @throws InvalidArgumentException If the prompt or model validation fails. @@ -1056,7 +1056,7 @@ public function generateSpeech(): File /** * Generates multiple speech outputs from the prompt. * - * @since n.e.x.t + * @since 0.1.0 * * @param int|null $candidateCount The number of speech outputs to generate. * @return list The generated speech audio files. @@ -1078,7 +1078,7 @@ public function generateSpeeches(?int $candidateCount = null): array * If the last message has a user role, the part is added to it. * Otherwise, a new UserMessage is created with the part. * - * @since n.e.x.t + * @since 0.1.0 * * @param MessagePart $part The part to append. * @return void @@ -1104,7 +1104,7 @@ protected function appendPartToMessages(MessagePart $part): void * If a model has been explicitly set, validates it meets requirements and returns it. * Otherwise, finds a suitable model based on the prompt requirements. * - * @since n.e.x.t + * @since 0.1.0 * * @param CapabilityEnum $capability The capability the model will be using. * @return ModelInterface The model to use. @@ -1180,7 +1180,7 @@ private function getConfiguredModel(CapabilityEnum $capability): ModelInterface /** * Parses various input types into a Message with the given role. * - * @since n.e.x.t + * @since 0.1.0 * * @param mixed $input The input to parse. * @param MessageRoleEnum $defaultRole The role for the message if not specified by input. @@ -1261,7 +1261,7 @@ private function parseMessage($input, MessageRoleEnum $defaultRole): Message * - The last message is a user message * - The last message has parts * - * @since n.e.x.t + * @since 0.1.0 * * @return void * @throws InvalidArgumentException If validation fails. @@ -1298,7 +1298,7 @@ private function validateMessages(): void /** * Checks if the value is a list of Message objects. * - * @since n.e.x.t + * @since 0.1.0 * * @param mixed $value The value to check. * @return bool True if the value is a list of Message objects. @@ -1327,7 +1327,7 @@ private function isMessagesList($value): bool * Checks if a RequiredOption with the same name already exists in the list. * If not, adds the new option. Returns the updated list. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $options The existing list of required options. * @param RequiredOption $option The option to potentially add. @@ -1355,7 +1355,7 @@ private function includeInRequiredOptions(array $options, RequiredOption $option * already included. If output modalities is null, initializes it with * the given modalities. * - * @since n.e.x.t + * @since 0.1.0 * * @param ModalityEnum ...$modalities The modalities to include. * @return void diff --git a/src/Common/AbstractDataTransferObject.php b/src/Common/AbstractDataTransferObject.php index 11baddd4..140ae1fa 100644 --- a/src/Common/AbstractDataTransferObject.php +++ b/src/Common/AbstractDataTransferObject.php @@ -22,7 +22,7 @@ * All DTOs in the AI Client should extend this class to ensure * consistent behavior across the codebase. * - * @since n.e.x.t + * @since 0.1.0 * * @template TArrayShape of array * @implements WithArrayTransformationInterface @@ -35,7 +35,7 @@ abstract class AbstractDataTransferObject implements /** * Validates that required keys exist in the array data. * - * @since n.e.x.t + * @since 0.1.0 * * @param array $data The array data to validate. * @param string[] $requiredKeys The keys that must be present. @@ -65,7 +65,7 @@ protected static function validateFromArrayData(array $data, array $requiredKeys /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function isArrayShape(array $array): bool { @@ -85,7 +85,7 @@ public static function isArrayShape(array $array): bool * based on the JSON schema to ensure proper object representation for * empty arrays. * - * @since n.e.x.t + * @since 0.1.0 * * @return mixed The JSON-serializable representation. */ @@ -101,7 +101,7 @@ public function jsonSerialize() /** * Recursively converts empty arrays to stdClass objects where the schema expects objects. * - * @since n.e.x.t + * @since 0.1.0 * * @param mixed $data The data to process. * @param array $schema The JSON schema for the data. diff --git a/src/Common/AbstractEnum.php b/src/Common/AbstractEnum.php index b6db168a..30403e41 100644 --- a/src/Common/AbstractEnum.php +++ b/src/Common/AbstractEnum.php @@ -35,7 +35,7 @@ * @property-read string $value The value of the enum instance. * @property-read string $name The name of the enum constant. * - * @since n.e.x.t + * @since 0.1.0 */ abstract class AbstractEnum implements JsonSerializable { @@ -62,7 +62,7 @@ abstract class AbstractEnum implements JsonSerializable /** * Constructor is private to ensure instances are created through static methods. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $value The enum value. * @param string $name The constant name. @@ -76,7 +76,7 @@ final private function __construct(string $value, string $name) /** * Provides read-only access to properties. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $property The property name. * @return mixed The property value. @@ -96,7 +96,7 @@ final public function __get(string $property) /** * Prevents property modification. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $property The property name. * @param mixed $value The value to set. @@ -112,7 +112,7 @@ final public function __set(string $property, $value): void /** * Creates an enum instance from a value, throws exception if invalid. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $value The enum value. * @return static The enum instance. @@ -132,7 +132,7 @@ final public static function from(string $value): self /** * Tries to create an enum instance from a value, returns null if invalid. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $value The enum value. * @return static|null The enum instance or null. @@ -151,7 +151,7 @@ final public static function tryFrom(string $value): ?self /** * Gets all enum cases. * - * @since n.e.x.t + * @since 0.1.0 * * @return static[] Array of all enum instances. */ @@ -168,7 +168,7 @@ final public static function cases(): array /** * Checks if this enum has the same value as the given value. * - * @since n.e.x.t + * @since 0.1.0 * * @param string|self $other The value or enum to compare. * @return bool True if values are equal. @@ -185,7 +185,7 @@ final public function equals($other): bool /** * Checks if this enum is the same instance type and value as another enum. * - * @since n.e.x.t + * @since 0.1.0 * * @param self $other The other enum to compare. * @return bool True if enums are identical. @@ -198,7 +198,7 @@ final public function is(self $other): bool /** * Gets all valid values for this enum. * - * @since n.e.x.t + * @since 0.1.0 * * @return string[] List of all enum values. */ @@ -210,7 +210,7 @@ final public static function getValues(): array /** * Checks if a value is valid for this enum. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $value The value to check. * @return bool True if value is valid. @@ -223,7 +223,7 @@ final public static function isValidValue(string $value): bool /** * Gets or creates a singleton instance for the given value and name. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $value The enum value. * @param string $name The constant name. @@ -249,7 +249,7 @@ private static function getInstance(string $value, string $name): self /** * Gets all constants for this enum class. * - * @since n.e.x.t + * @since 0.1.0 * * @return array Map of constant names to values. * @throws RuntimeException If invalid constant found. @@ -271,7 +271,7 @@ final protected static function getConstants(): array * This method can be overridden by subclasses to customize how * enumerations are determined (e.g., to add dynamic constants). * - * @since n.e.x.t + * @since 0.1.0 * * @param class-string $className The fully qualified class name. * @return array Map of constant names to values. @@ -318,7 +318,7 @@ protected static function determineClassEnumerations(string $className): array /** * Handles dynamic method calls for enum checking. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $name The method name. * @param array $arguments The method arguments. @@ -345,7 +345,7 @@ final public function __call(string $name, array $arguments): bool /** * Handles static method calls for enum creation. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $name The method name. * @param array $arguments The method arguments. @@ -369,7 +369,7 @@ final public static function __callStatic(string $name, array $arguments): self /** * Converts camelCase to CONSTANT_CASE. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $camelCase The camelCase string. * @return string The CONSTANT_CASE version. @@ -386,7 +386,7 @@ private static function camelCaseToConstant(string $camelCase): string /** * Returns string representation of the enum. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The enum value. */ @@ -398,7 +398,7 @@ final public function __toString(): string /** * Converts the enum to a JSON-serializable format. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The enum value. */ diff --git a/src/Common/Contracts/WithArrayTransformationInterface.php b/src/Common/Contracts/WithArrayTransformationInterface.php index 5d158e1b..fd6ccaa8 100644 --- a/src/Common/Contracts/WithArrayTransformationInterface.php +++ b/src/Common/Contracts/WithArrayTransformationInterface.php @@ -7,7 +7,7 @@ /** * Interface for objects that support array transformation. * - * @since n.e.x.t + * @since 0.1.0 * * @template TArrayShape of array */ @@ -16,7 +16,7 @@ interface WithArrayTransformationInterface /** * Converts the object to an array representation. * - * @since n.e.x.t + * @since 0.1.0 * * @return TArrayShape The array representation. */ @@ -25,7 +25,7 @@ public function toArray(): array; /** * Creates an instance from array data. * - * @since n.e.x.t + * @since 0.1.0 * * @param TArrayShape $array The array data. * @return self The created instance. @@ -35,7 +35,7 @@ public static function fromArray(array $array): self; /** * Checks if the array is a valid shape for this object. * - * @since n.e.x.t + * @since 0.1.0 * * @param array $array The array to check. * @return bool True if the array is a valid shape. diff --git a/src/Common/Contracts/WithJsonSchemaInterface.php b/src/Common/Contracts/WithJsonSchemaInterface.php index 889a69ff..ede2055b 100644 --- a/src/Common/Contracts/WithJsonSchemaInterface.php +++ b/src/Common/Contracts/WithJsonSchemaInterface.php @@ -10,14 +10,14 @@ * This interface is implemented by DTOs to provide a consistent way to retrieve * their JSON schema for validation and serialization purposes. * - * @since n.e.x.t + * @since 0.1.0 */ interface WithJsonSchemaInterface { /** * Gets the JSON schema representation of the object. * - * @since n.e.x.t + * @since 0.1.0 * * @return array The JSON schema as an associative array. */ diff --git a/src/Files/DTO/File.php b/src/Files/DTO/File.php index ee731ff9..cbf95feb 100644 --- a/src/Files/DTO/File.php +++ b/src/Files/DTO/File.php @@ -16,7 +16,7 @@ * This DTO automatically detects whether a file is a URL, base64 data, or local file path * and handles them appropriately. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-type FileArrayShape array{ * fileType: string, @@ -56,7 +56,7 @@ class File extends AbstractDataTransferObject /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $file The file string (URL, base64 data, or local path). * @param string|null $mimeType The MIME type of the file (optional). @@ -71,7 +71,7 @@ public function __construct(string $file, ?string $mimeType = null) /** * Detects the file type and processes it accordingly. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $file The file string to process. * @param string|null $providedMimeType The explicitly provided MIME type. @@ -129,7 +129,7 @@ private function detectAndProcessFile(string $file, ?string $providedMimeType): /** * Checks if a string is a valid URL. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $string The string to check. * @return bool True if the string is a URL. @@ -143,7 +143,7 @@ private function isUrl(string $string): bool /** * Converts a local file to base64. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $filePath The path to the local file. * @return string The base64-encoded file data. @@ -165,7 +165,7 @@ private function convertFileToBase64(string $filePath): string /** * Gets the file type. * - * @since n.e.x.t + * @since 0.1.0 * * @return FileTypeEnum The file type. */ @@ -177,7 +177,7 @@ public function getFileType(): FileTypeEnum /** * Checks if the file is an inline file. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if the file is inline (base64/data URI). */ @@ -189,7 +189,7 @@ public function isInline(): bool /** * Checks if the file is a remote file. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if the file is remote (URL). */ @@ -201,7 +201,7 @@ public function isRemote(): bool /** * Gets the URL for remote files. * - * @since n.e.x.t + * @since 0.1.0 * * @return string|null The URL, or null if not a remote file. */ @@ -213,7 +213,7 @@ public function getUrl(): ?string /** * Gets the base64-encoded data for inline files. * - * @since n.e.x.t + * @since 0.1.0 * * @return string|null The plain base64-encoded data (without data URI prefix), or null if not an inline file. */ @@ -225,7 +225,7 @@ public function getBase64Data(): ?string /** * Gets the data as a data URI for inline files. * - * @since n.e.x.t + * @since 0.1.0 * * @return string|null The data URI in format: data:[mimeType];base64,[data], or null if not an inline file. */ @@ -241,7 +241,7 @@ public function getDataUri(): ?string /** * Gets the MIME type of the file as a string. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The MIME type string value. */ @@ -253,7 +253,7 @@ public function getMimeType(): string /** * Gets the MIME type object. * - * @since n.e.x.t + * @since 0.1.0 * * @return MimeType The MIME type object. */ @@ -265,7 +265,7 @@ public function getMimeTypeObject(): MimeType /** * Checks if the file is a video. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if the file is a video. */ @@ -277,7 +277,7 @@ public function isVideo(): bool /** * Checks if the file is an image. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if the file is an image. */ @@ -289,7 +289,7 @@ public function isImage(): bool /** * Checks if the file is audio. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if the file is audio. */ @@ -301,7 +301,7 @@ public function isAudio(): bool /** * Checks if the file is text. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if the file is text. */ @@ -313,7 +313,7 @@ public function isText(): bool /** * Checks if the file is a document. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if the file is a document. */ @@ -325,7 +325,7 @@ public function isDocument(): bool /** * Checks if the file is a specific MIME type. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $type The mime type to check (e.g. 'image', 'text', 'video', 'audio'). * @@ -339,7 +339,7 @@ public function isMimeType(string $type): bool /** * Determines the MIME type from various sources. * - * @since n.e.x.t + * @since 0.1.0 * * @param string|null $providedMimeType The explicitly provided MIME type. * @param string|null $extractedMimeType The MIME type extracted from data URI. @@ -392,7 +392,7 @@ private function determineMimeType( /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -447,7 +447,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return FileArrayShape */ @@ -474,7 +474,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Files/Enums/FileTypeEnum.php b/src/Files/Enums/FileTypeEnum.php index 557bc5ca..b0fd16cb 100644 --- a/src/Files/Enums/FileTypeEnum.php +++ b/src/Files/Enums/FileTypeEnum.php @@ -14,7 +14,7 @@ * @method bool isInline() Checks if this is an inline file type. * @method bool isRemote() Checks if this is a remote file type. * - * @since n.e.x.t + * @since 0.1.0 */ class FileTypeEnum extends AbstractEnum { diff --git a/src/Files/Enums/MediaOrientationEnum.php b/src/Files/Enums/MediaOrientationEnum.php index cf12f795..733d11cc 100644 --- a/src/Files/Enums/MediaOrientationEnum.php +++ b/src/Files/Enums/MediaOrientationEnum.php @@ -16,7 +16,7 @@ * @method bool isLandscape() Checks if this is a landscape orientation. * @method bool isPortrait() Checks if this is a portrait orientation. * - * @since n.e.x.t + * @since 0.1.0 */ class MediaOrientationEnum extends AbstractEnum { diff --git a/src/Files/ValueObjects/MimeType.php b/src/Files/ValueObjects/MimeType.php index 7420239a..1bf7b8a8 100644 --- a/src/Files/ValueObjects/MimeType.php +++ b/src/Files/ValueObjects/MimeType.php @@ -12,7 +12,7 @@ * This immutable value object encapsulates MIME type validation and * provides convenient methods for checking MIME type categories. * - * @since n.e.x.t + * @since 0.1.0 */ final class MimeType { @@ -115,7 +115,7 @@ final class MimeType /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $value The MIME type value. * @throws InvalidArgumentException If the MIME type is invalid. @@ -134,7 +134,7 @@ public function __construct(string $value) /** * Gets the primary known file extension for this MIME type. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The file extension (without the dot). * @throws InvalidArgumentException If no known extension exists for this MIME type. @@ -155,7 +155,7 @@ public function toExtension(): string /** * Creates a MimeType from a file extension. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $extension The file extension (without the dot). * @return self The MimeType instance. @@ -177,7 +177,7 @@ public static function fromExtension(string $extension): self /** * Checks if a MIME type string is valid. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $mimeType The MIME type to validate. * @return bool True if valid. @@ -197,7 +197,7 @@ public static function isValid(string $mimeType): bool * This method returns true when the stored MIME type begins with the * given prefix. For example, `"audio"` matches `"audio/mpeg"`. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $mimeType The MIME type prefix to check (e.g., "audio", "image"). * @return bool True if this MIME type is of the specified type. @@ -210,7 +210,7 @@ public function isType(string $mimeType): bool /** * Checks if this is an image MIME type. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if this is an image type. */ @@ -222,7 +222,7 @@ public function isImage(): bool /** * Checks if this is an audio MIME type. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if this is an audio type. */ @@ -234,7 +234,7 @@ public function isAudio(): bool /** * Checks if this is a video MIME type. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if this is a video type. */ @@ -246,7 +246,7 @@ public function isVideo(): bool /** * Checks if this is a text MIME type. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if this is a text type. */ @@ -258,7 +258,7 @@ public function isText(): bool /** * Checks if this is a document MIME type. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if this is a document type. */ @@ -270,7 +270,7 @@ public function isDocument(): bool /** * Checks if this MIME type equals another. * - * @since n.e.x.t + * @since 0.1.0 * * @param self|string $other The other MIME type to compare. * @return bool True if equal. @@ -293,7 +293,7 @@ public function equals($other): bool /** * Gets the string representation of the MIME type. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The MIME type value. */ diff --git a/src/Messages/DTO/Message.php b/src/Messages/DTO/Message.php index c07ca9e5..b42c1b08 100644 --- a/src/Messages/DTO/Message.php +++ b/src/Messages/DTO/Message.php @@ -14,7 +14,7 @@ * Messages are the fundamental unit of communication with AI models, * containing a role and one or more parts with different content types. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-import-type MessagePartArrayShape from MessagePart * @@ -42,7 +42,7 @@ class Message extends AbstractDataTransferObject /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param MessageRoleEnum $role The role of the message sender. * @param MessagePart[] $parts The parts that make up this message. @@ -58,7 +58,7 @@ public function __construct(MessageRoleEnum $role, array $parts) /** * Gets the role of the message sender. * - * @since n.e.x.t + * @since 0.1.0 * * @return MessageRoleEnum The role. */ @@ -70,7 +70,7 @@ public function getRole(): MessageRoleEnum /** * Gets the message parts. * - * @since n.e.x.t + * @since 0.1.0 * * @return MessagePart[] The message parts. */ @@ -82,7 +82,7 @@ public function getParts(): array /** * Returns a new instance with the given part appended. * - * @since n.e.x.t + * @since 0.1.0 * * @param MessagePart $part The part to append. * @return Message A new instance with the part appended. @@ -99,7 +99,7 @@ public function withPart(MessagePart $part): Message /** * Validates that the message parts are appropriate for the message role. * - * @since n.e.x.t + * @since 0.1.0 * * @return void * @throws InvalidArgumentException If validation fails. @@ -124,7 +124,7 @@ private function validateParts(): void /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -150,7 +150,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return MessageArrayShape */ @@ -167,7 +167,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return self The specific message class based on the role. */ diff --git a/src/Messages/DTO/MessagePart.php b/src/Messages/DTO/MessagePart.php index f28a53fd..790dc576 100644 --- a/src/Messages/DTO/MessagePart.php +++ b/src/Messages/DTO/MessagePart.php @@ -19,7 +19,7 @@ * Messages can contain multiple parts of different types, such as text, files, * function calls, etc. This DTO encapsulates one such part. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-import-type FileArrayShape from File * @phpstan-import-type FunctionCallArrayShape from FunctionCall @@ -78,7 +78,7 @@ class MessagePart extends AbstractDataTransferObject /** * Constructor that accepts various content types and infers the message part type. * - * @since n.e.x.t + * @since 0.1.0 * * @param mixed $content The content of this message part. * @param MessagePartChannelEnum|null $channel The channel this part belongs to. Defaults to CONTENT. @@ -115,7 +115,7 @@ public function __construct($content, ?MessagePartChannelEnum $channel = null) /** * Gets the channel this message part belongs to. * - * @since n.e.x.t + * @since 0.1.0 * * @return MessagePartChannelEnum The channel. */ @@ -127,7 +127,7 @@ public function getChannel(): MessagePartChannelEnum /** * Gets the type of this message part. * - * @since n.e.x.t + * @since 0.1.0 * * @return MessagePartTypeEnum The type. */ @@ -139,7 +139,7 @@ public function getType(): MessagePartTypeEnum /** * Gets the text content. * - * @since n.e.x.t + * @since 0.1.0 * * @return string|null The text content or null if not a text part. */ @@ -151,7 +151,7 @@ public function getText(): ?string /** * Gets the file. * - * @since n.e.x.t + * @since 0.1.0 * * @return File|null The file or null if not a file part. */ @@ -163,7 +163,7 @@ public function getFile(): ?File /** * Gets the function call. * - * @since n.e.x.t + * @since 0.1.0 * * @return FunctionCall|null The function call or null if not a function call part. */ @@ -175,7 +175,7 @@ public function getFunctionCall(): ?FunctionCall /** * Gets the function response. * - * @since n.e.x.t + * @since 0.1.0 * * @return FunctionResponse|null The function response or null if not a function response part. */ @@ -187,7 +187,7 @@ public function getFunctionResponse(): ?FunctionResponse /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -261,7 +261,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return MessagePartArrayShape */ @@ -293,7 +293,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Messages/DTO/ModelMessage.php b/src/Messages/DTO/ModelMessage.php index 2b160cc3..938759dd 100644 --- a/src/Messages/DTO/ModelMessage.php +++ b/src/Messages/DTO/ModelMessage.php @@ -16,14 +16,14 @@ * This is merely a helper class for construction. Always use `$message->getRole()` * to check the role of a message. * - * @since n.e.x.t + * @since 0.1.0 */ class ModelMessage extends Message { /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param MessagePart[] $parts The parts that make up this message. */ diff --git a/src/Messages/DTO/UserMessage.php b/src/Messages/DTO/UserMessage.php index 84aded05..3392223a 100644 --- a/src/Messages/DTO/UserMessage.php +++ b/src/Messages/DTO/UserMessage.php @@ -15,14 +15,14 @@ * This is merely a helper class for construction. Always use `$message->getRole()` * to check the role of a message. * - * @since n.e.x.t + * @since 0.1.0 */ class UserMessage extends Message { /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param MessagePart[] $parts The parts that make up this message. */ diff --git a/src/Messages/Enums/MessagePartChannelEnum.php b/src/Messages/Enums/MessagePartChannelEnum.php index 03b0947f..8ebf62f3 100644 --- a/src/Messages/Enums/MessagePartChannelEnum.php +++ b/src/Messages/Enums/MessagePartChannelEnum.php @@ -9,7 +9,7 @@ /** * Enum for message part channels. * - * @since n.e.x.t + * @since 0.1.0 * * @method static self content() Creates an instance for CONTENT channel. * @method static self thought() Creates an instance for THOUGHT channel. diff --git a/src/Messages/Enums/MessagePartTypeEnum.php b/src/Messages/Enums/MessagePartTypeEnum.php index 3db70b9a..ed7b7064 100644 --- a/src/Messages/Enums/MessagePartTypeEnum.php +++ b/src/Messages/Enums/MessagePartTypeEnum.php @@ -9,7 +9,7 @@ /** * Enum for message part types. * - * @since n.e.x.t + * @since 0.1.0 * * @method static self text() Creates an instance for TEXT type. * @method static self file() Creates an instance for FILE type. diff --git a/src/Messages/Enums/MessageRoleEnum.php b/src/Messages/Enums/MessageRoleEnum.php index fdc28171..554e5450 100644 --- a/src/Messages/Enums/MessageRoleEnum.php +++ b/src/Messages/Enums/MessageRoleEnum.php @@ -9,7 +9,7 @@ /** * Enum for message roles in AI conversations. * - * @since n.e.x.t + * @since 0.1.0 * * @method static self user() Creates an instance for USER role. * @method static self model() Creates an instance for MODEL role. diff --git a/src/Messages/Enums/ModalityEnum.php b/src/Messages/Enums/ModalityEnum.php index 3732cc32..74e83f8c 100644 --- a/src/Messages/Enums/ModalityEnum.php +++ b/src/Messages/Enums/ModalityEnum.php @@ -9,7 +9,7 @@ /** * Enum for input/output modalities. * - * @since n.e.x.t + * @since 0.1.0 * * @method static self text() Creates an instance for TEXT modality. * @method static self document() Creates an instance for DOCUMENT modality. diff --git a/src/Operations/Contracts/OperationInterface.php b/src/Operations/Contracts/OperationInterface.php index 2594d0e6..0fc3b0d3 100644 --- a/src/Operations/Contracts/OperationInterface.php +++ b/src/Operations/Contracts/OperationInterface.php @@ -12,14 +12,14 @@ * Operations represent long-running AI tasks that may not complete immediately. * They provide a way to track the progress and retrieve results asynchronously. * - * @since n.e.x.t + * @since 0.1.0 */ interface OperationInterface { /** * Gets the operation ID. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The unique operation identifier. */ @@ -28,7 +28,7 @@ public function getId(): string; /** * Gets the current state of the operation. * - * @since n.e.x.t + * @since 0.1.0 * * @return OperationStateEnum The operation state. */ diff --git a/src/Operations/DTO/GenerativeAiOperation.php b/src/Operations/DTO/GenerativeAiOperation.php index bc0a6f09..a82dc268 100644 --- a/src/Operations/DTO/GenerativeAiOperation.php +++ b/src/Operations/DTO/GenerativeAiOperation.php @@ -15,7 +15,7 @@ * This DTO tracks the progress of generative AI tasks that may not complete * immediately, providing access to the result once available. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-import-type GenerativeAiResultArrayShape from GenerativeAiResult * @@ -46,7 +46,7 @@ class GenerativeAiOperation extends AbstractDataTransferObject implements Operat /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $id Unique identifier for this operation. * @param OperationStateEnum $state The current state of the operation. @@ -62,7 +62,7 @@ public function __construct(string $id, OperationStateEnum $state, ?GenerativeAi /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function getId(): string { @@ -72,7 +72,7 @@ public function getId(): string /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function getState(): OperationStateEnum { @@ -82,7 +82,7 @@ public function getState(): OperationStateEnum /** * Gets the operation result. * - * @since n.e.x.t + * @since 0.1.0 * * @return GenerativeAiResult|null The result or null if not yet complete. */ @@ -94,7 +94,7 @@ public function getResult(): ?GenerativeAiResult /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -146,7 +146,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return GenerativeAiOperationArrayShape */ @@ -167,7 +167,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Operations/Enums/OperationStateEnum.php b/src/Operations/Enums/OperationStateEnum.php index 32d8770d..cb996574 100644 --- a/src/Operations/Enums/OperationStateEnum.php +++ b/src/Operations/Enums/OperationStateEnum.php @@ -9,7 +9,7 @@ /** * Enum for operation states. * - * @since n.e.x.t + * @since 0.1.0 * * @method static self starting() Creates an instance for STARTING state. * @method static self processing() Creates an instance for PROCESSING state. diff --git a/src/ProviderImplementations/Anthropic/AnthropicApiKeyRequestAuthentication.php b/src/ProviderImplementations/Anthropic/AnthropicApiKeyRequestAuthentication.php index 468cefc5..57a93cd0 100644 --- a/src/ProviderImplementations/Anthropic/AnthropicApiKeyRequestAuthentication.php +++ b/src/ProviderImplementations/Anthropic/AnthropicApiKeyRequestAuthentication.php @@ -10,7 +10,7 @@ /** * Class for HTTP request authentication using an API key in a Anthropic API compliant way. * - * @since n.e.x.t + * @since 0.1.0 */ class AnthropicApiKeyRequestAuthentication extends ApiKeyRequestAuthentication { @@ -19,7 +19,7 @@ class AnthropicApiKeyRequestAuthentication extends ApiKeyRequestAuthentication /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function authenticateRequest(Request $request): Request { diff --git a/src/ProviderImplementations/Anthropic/AnthropicModelMetadataDirectory.php b/src/ProviderImplementations/Anthropic/AnthropicModelMetadataDirectory.php index 0e75c714..e8f06079 100644 --- a/src/ProviderImplementations/Anthropic/AnthropicModelMetadataDirectory.php +++ b/src/ProviderImplementations/Anthropic/AnthropicModelMetadataDirectory.php @@ -20,7 +20,7 @@ /** * Class for the Anthropic model metadata directory. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-type ModelsResponseData array{ * data: list @@ -31,7 +31,7 @@ class AnthropicModelMetadataDirectory extends AbstractOpenAiCompatibleModelMetad /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function getRequestAuthentication(): RequestAuthenticationInterface { @@ -49,7 +49,7 @@ public function getRequestAuthentication(): RequestAuthenticationInterface /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ protected function createRequest(HttpMethodEnum $method, string $path, array $headers = [], $data = null): Request { @@ -64,7 +64,7 @@ protected function createRequest(HttpMethodEnum $method, string $path, array $he /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ protected function parseResponseToModelMetadataList(Response $response): array { diff --git a/src/ProviderImplementations/Anthropic/AnthropicProvider.php b/src/ProviderImplementations/Anthropic/AnthropicProvider.php index af598bfe..74945276 100644 --- a/src/ProviderImplementations/Anthropic/AnthropicProvider.php +++ b/src/ProviderImplementations/Anthropic/AnthropicProvider.php @@ -17,7 +17,7 @@ /** * Class for the Anthropic provider. * - * @since n.e.x.t + * @since 0.1.0 */ class AnthropicProvider extends AbstractProvider { @@ -26,7 +26,7 @@ class AnthropicProvider extends AbstractProvider /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ protected static function createModel( ModelMetadata $modelMetadata, @@ -47,7 +47,7 @@ protected static function createModel( /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ protected static function createProviderMetadata(): ProviderMetadata { @@ -61,7 +61,7 @@ protected static function createProviderMetadata(): ProviderMetadata /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ protected static function createProviderAvailability(): ProviderAvailabilityInterface { @@ -74,7 +74,7 @@ protected static function createProviderAvailability(): ProviderAvailabilityInte /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ protected static function createModelMetadataDirectory(): ModelMetadataDirectoryInterface { diff --git a/src/ProviderImplementations/Anthropic/AnthropicTextGenerationModel.php b/src/ProviderImplementations/Anthropic/AnthropicTextGenerationModel.php index e7f48fc7..d0e8c10d 100644 --- a/src/ProviderImplementations/Anthropic/AnthropicTextGenerationModel.php +++ b/src/ProviderImplementations/Anthropic/AnthropicTextGenerationModel.php @@ -11,14 +11,14 @@ /** * Class for an Anthropic text generation model. * - * @since n.e.x.t + * @since 0.1.0 */ class AnthropicTextGenerationModel extends AbstractOpenAiCompatibleTextGenerationModel { /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ protected function createRequest(HttpMethodEnum $method, string $path, array $headers = [], $data = null): Request { diff --git a/src/ProviderImplementations/Google/GoogleApiKeyRequestAuthentication.php b/src/ProviderImplementations/Google/GoogleApiKeyRequestAuthentication.php index 9059458a..38f5a2b0 100644 --- a/src/ProviderImplementations/Google/GoogleApiKeyRequestAuthentication.php +++ b/src/ProviderImplementations/Google/GoogleApiKeyRequestAuthentication.php @@ -13,14 +13,14 @@ * This is only relevant when calling the primary Google Gemini API endpoints. It is not relevant when calling the * OpenAI-compatible endpoints. * - * @since n.e.x.t + * @since 0.1.0 */ class GoogleApiKeyRequestAuthentication extends ApiKeyRequestAuthentication { /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function authenticateRequest(Request $request): Request { diff --git a/src/ProviderImplementations/Google/GoogleImageGenerationModel.php b/src/ProviderImplementations/Google/GoogleImageGenerationModel.php index d89df321..16a70981 100644 --- a/src/ProviderImplementations/Google/GoogleImageGenerationModel.php +++ b/src/ProviderImplementations/Google/GoogleImageGenerationModel.php @@ -11,7 +11,7 @@ /** * Class for a Google image generation model. * - * @since n.e.x.t + * @since 0.1.0 */ class GoogleImageGenerationModel extends AbstractOpenAiCompatibleImageGenerationModel { diff --git a/src/ProviderImplementations/Google/GoogleModelMetadataDirectory.php b/src/ProviderImplementations/Google/GoogleModelMetadataDirectory.php index 76d71d06..a01237aa 100644 --- a/src/ProviderImplementations/Google/GoogleModelMetadataDirectory.php +++ b/src/ProviderImplementations/Google/GoogleModelMetadataDirectory.php @@ -22,7 +22,7 @@ /** * Class for the Google model metadata directory. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-type ModelsResponseData array{ * models: list @@ -31,7 +31,7 @@ class OpenAiModelMetadataDirectory extends AbstractOpenAiCompatibleModelMetadata /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ protected function createRequest(HttpMethodEnum $method, string $path, array $headers = [], $data = null): Request { @@ -46,7 +46,7 @@ protected function createRequest(HttpMethodEnum $method, string $path, array $he /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ protected function parseResponseToModelMetadataList(Response $response): array { diff --git a/src/ProviderImplementations/OpenAi/OpenAiProvider.php b/src/ProviderImplementations/OpenAi/OpenAiProvider.php index a7de9636..2c4ef073 100644 --- a/src/ProviderImplementations/OpenAi/OpenAiProvider.php +++ b/src/ProviderImplementations/OpenAi/OpenAiProvider.php @@ -17,7 +17,7 @@ /** * Class for the OpenAI provider. * - * @since n.e.x.t + * @since 0.1.0 */ class OpenAiProvider extends AbstractProvider { @@ -26,7 +26,7 @@ class OpenAiProvider extends AbstractProvider /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ protected static function createModel( ModelMetadata $modelMetadata, @@ -56,7 +56,7 @@ protected static function createModel( /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ protected static function createProviderMetadata(): ProviderMetadata { @@ -70,7 +70,7 @@ protected static function createProviderMetadata(): ProviderMetadata /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ protected static function createProviderAvailability(): ProviderAvailabilityInterface { @@ -83,7 +83,7 @@ protected static function createProviderAvailability(): ProviderAvailabilityInte /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ protected static function createModelMetadataDirectory(): ModelMetadataDirectoryInterface { diff --git a/src/ProviderImplementations/OpenAi/OpenAiTextGenerationModel.php b/src/ProviderImplementations/OpenAi/OpenAiTextGenerationModel.php index 66823ad7..66793eac 100644 --- a/src/ProviderImplementations/OpenAi/OpenAiTextGenerationModel.php +++ b/src/ProviderImplementations/OpenAi/OpenAiTextGenerationModel.php @@ -11,14 +11,14 @@ /** * Class for an OpenAI text generation model. * - * @since n.e.x.t + * @since 0.1.0 */ class OpenAiTextGenerationModel extends AbstractOpenAiCompatibleTextGenerationModel { /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ protected function createRequest(HttpMethodEnum $method, string $path, array $headers = [], $data = null): Request { diff --git a/src/Providers/AbstractProvider.php b/src/Providers/AbstractProvider.php index 802ce8cc..115311a8 100644 --- a/src/Providers/AbstractProvider.php +++ b/src/Providers/AbstractProvider.php @@ -15,7 +15,7 @@ /** * Base class for a provider. * - * @since n.e.x.t + * @since 0.1.0 */ abstract class AbstractProvider implements ProviderInterface { @@ -37,7 +37,7 @@ abstract class AbstractProvider implements ProviderInterface /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ final public static function metadata(): ProviderMetadata { @@ -51,7 +51,7 @@ final public static function metadata(): ProviderMetadata /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ final public static function model(string $modelId, ?ModelConfig $modelConfig = null): ModelInterface { @@ -68,7 +68,7 @@ final public static function model(string $modelId, ?ModelConfig $modelConfig = /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ final public static function availability(): ProviderAvailabilityInterface { @@ -82,7 +82,7 @@ final public static function availability(): ProviderAvailabilityInterface /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ final public static function modelMetadataDirectory(): ModelMetadataDirectoryInterface { @@ -96,7 +96,7 @@ final public static function modelMetadataDirectory(): ModelMetadataDirectoryInt /** * Creates a model instance based on the given model metadata and provider metadata. * - * @since n.e.x.t + * @since 0.1.0 * * @param ModelMetadata $modelMetadata The model metadata. * @param ProviderMetadata $providerMetadata The provider metadata. @@ -110,7 +110,7 @@ abstract protected static function createModel( /** * Creates the provider metadata instance. * - * @since n.e.x.t + * @since 0.1.0 * * @return ProviderMetadata The provider metadata. */ @@ -119,7 +119,7 @@ abstract protected static function createProviderMetadata(): ProviderMetadata; /** * Creates the provider availability instance. * - * @since n.e.x.t + * @since 0.1.0 * * @return ProviderAvailabilityInterface The provider availability. */ @@ -128,7 +128,7 @@ abstract protected static function createProviderAvailability(): ProviderAvailab /** * Creates the model metadata directory instance. * - * @since n.e.x.t + * @since 0.1.0 * * @return ModelMetadataDirectoryInterface The model metadata directory. */ diff --git a/src/Providers/ApiBasedImplementation/AbstractApiBasedModel.php b/src/Providers/ApiBasedImplementation/AbstractApiBasedModel.php index 7d6a34ef..cc9760ef 100644 --- a/src/Providers/ApiBasedImplementation/AbstractApiBasedModel.php +++ b/src/Providers/ApiBasedImplementation/AbstractApiBasedModel.php @@ -19,7 +19,7 @@ * While this class contains no abstract methods, it is still abstract to ensure that each model class can actually * perform generative AI tasks by implementing the corresponding interfaces. * - * @since n.e.x.t + * @since 0.1.0 */ abstract class AbstractApiBasedModel implements ModelInterface, @@ -47,7 +47,7 @@ abstract class AbstractApiBasedModel implements /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param ModelMetadata $metadata The metadata for the model. * @param ProviderMetadata $providerMetadata The metadata for the model's provider. @@ -62,7 +62,7 @@ public function __construct(ModelMetadata $metadata, ProviderMetadata $providerM /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ final public function metadata(): ModelMetadata { @@ -72,7 +72,7 @@ final public function metadata(): ModelMetadata /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ final public function providerMetadata(): ProviderMetadata { @@ -82,7 +82,7 @@ final public function providerMetadata(): ProviderMetadata /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ final public function setConfig(ModelConfig $config): void { @@ -92,7 +92,7 @@ final public function setConfig(ModelConfig $config): void /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ final public function getConfig(): ModelConfig { diff --git a/src/Providers/ApiBasedImplementation/AbstractApiBasedModelMetadataDirectory.php b/src/Providers/ApiBasedImplementation/AbstractApiBasedModelMetadataDirectory.php index aa27265f..92f19813 100644 --- a/src/Providers/ApiBasedImplementation/AbstractApiBasedModelMetadataDirectory.php +++ b/src/Providers/ApiBasedImplementation/AbstractApiBasedModelMetadataDirectory.php @@ -15,7 +15,7 @@ /** * Base class for an API-based model metadata directory for a provider. * - * @since n.e.x.t + * @since 0.1.0 */ abstract class AbstractApiBasedModelMetadataDirectory implements ModelMetadataDirectoryInterface, @@ -33,7 +33,7 @@ abstract class AbstractApiBasedModelMetadataDirectory implements /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ final public function listModelMetadata(): array { @@ -44,7 +44,7 @@ final public function listModelMetadata(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ final public function hasModelMetadata(string $modelId): bool { @@ -55,7 +55,7 @@ final public function hasModelMetadata(string $modelId): bool /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ final public function getModelMetadata(string $modelId): ModelMetadata { @@ -71,7 +71,7 @@ final public function getModelMetadata(string $modelId): ModelMetadata /** * Returns the map of model ID to model metadata for all models from the provider. * - * @since n.e.x.t + * @since 0.1.0 * * @return array Map of model ID to model metadata. */ @@ -86,7 +86,7 @@ private function getModelMetadataMap(): array /** * Sends the API request to list models from the provider and returns the map of model ID to model metadata. * - * @since n.e.x.t + * @since 0.1.0 * * @return array Map of model ID to model metadata. */ diff --git a/src/Providers/ApiBasedImplementation/GenerateTextApiBasedProviderAvailability.php b/src/Providers/ApiBasedImplementation/GenerateTextApiBasedProviderAvailability.php index 37fcf998..68de72b2 100644 --- a/src/Providers/ApiBasedImplementation/GenerateTextApiBasedProviderAvailability.php +++ b/src/Providers/ApiBasedImplementation/GenerateTextApiBasedProviderAvailability.php @@ -20,7 +20,7 @@ * text generation endpoint which requires authentication. A minimal request to this endpoint is used to determine * if the provider is properly configured with valid credentials. * - * @since n.e.x.t + * @since 0.1.0 */ class GenerateTextApiBasedProviderAvailability implements ProviderAvailabilityInterface { @@ -32,7 +32,7 @@ class GenerateTextApiBasedProviderAvailability implements ProviderAvailabilityIn /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param ModelInterface $model The model to use for checking availability. */ @@ -49,7 +49,7 @@ public function __construct(ModelInterface $model) /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function isConfigured(): bool { diff --git a/src/Providers/ApiBasedImplementation/ListModelsApiBasedProviderAvailability.php b/src/Providers/ApiBasedImplementation/ListModelsApiBasedProviderAvailability.php index ff1010ac..0ee1daf7 100644 --- a/src/Providers/ApiBasedImplementation/ListModelsApiBasedProviderAvailability.php +++ b/src/Providers/ApiBasedImplementation/ListModelsApiBasedProviderAvailability.php @@ -15,7 +15,7 @@ * authentication. A request to this endpoint is used to determine if the provider is properly configured * with valid credentials. * - * @since n.e.x.t + * @since 0.1.0 */ class ListModelsApiBasedProviderAvailability implements ProviderAvailabilityInterface { @@ -27,7 +27,7 @@ class ListModelsApiBasedProviderAvailability implements ProviderAvailabilityInte /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param ModelMetadataDirectoryInterface $modelMetadataDirectory The model metadata directory to use for checking * availability. @@ -40,7 +40,7 @@ public function __construct(ModelMetadataDirectoryInterface $modelMetadataDirect /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function isConfigured(): bool { diff --git a/src/Providers/Contracts/ModelMetadataDirectoryInterface.php b/src/Providers/Contracts/ModelMetadataDirectoryInterface.php index 1e08e008..a769338c 100644 --- a/src/Providers/Contracts/ModelMetadataDirectoryInterface.php +++ b/src/Providers/Contracts/ModelMetadataDirectoryInterface.php @@ -13,14 +13,14 @@ * Provides methods to list, check, and retrieve model metadata * for all models supported by a provider. * - * @since n.e.x.t + * @since 0.1.0 */ interface ModelMetadataDirectoryInterface { /** * Lists all available model metadata. * - * @since n.e.x.t + * @since 0.1.0 * * @return list Array of model metadata. */ @@ -29,7 +29,7 @@ public function listModelMetadata(): array; /** * Checks if metadata exists for a specific model. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $modelId Model identifier. * @return bool True if metadata exists, false otherwise. @@ -39,7 +39,7 @@ public function hasModelMetadata(string $modelId): bool; /** * Gets metadata for a specific model. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $modelId Model identifier. * @return ModelMetadata Model metadata. diff --git a/src/Providers/Contracts/ProviderAvailabilityInterface.php b/src/Providers/Contracts/ProviderAvailabilityInterface.php index 98964915..7fae2fb0 100644 --- a/src/Providers/Contracts/ProviderAvailabilityInterface.php +++ b/src/Providers/Contracts/ProviderAvailabilityInterface.php @@ -10,14 +10,14 @@ * Determines whether a provider is configured and available * for use based on API keys, credentials, or other requirements. * - * @since n.e.x.t + * @since 0.1.0 */ interface ProviderAvailabilityInterface { /** * Checks if the provider is configured. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if the provider is configured and available, false otherwise. */ diff --git a/src/Providers/Contracts/ProviderInterface.php b/src/Providers/Contracts/ProviderInterface.php index 5ff5c808..f59b6367 100644 --- a/src/Providers/Contracts/ProviderInterface.php +++ b/src/Providers/Contracts/ProviderInterface.php @@ -15,14 +15,14 @@ * Providers represent AI services (Google, OpenAI, Anthropic, etc.) * and provide access to models, metadata, and availability information. * - * @since n.e.x.t + * @since 0.1.0 */ interface ProviderInterface { /** * Gets provider metadata. * - * @since n.e.x.t + * @since 0.1.0 * * @return ProviderMetadata Provider metadata. */ @@ -31,7 +31,7 @@ public static function metadata(): ProviderMetadata; /** * Creates a model instance. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $modelId Model identifier. * @param ?ModelConfig $modelConfig Model configuration. @@ -43,7 +43,7 @@ public static function model(string $modelId, ?ModelConfig $modelConfig = null): /** * Gets provider availability checker. * - * @since n.e.x.t + * @since 0.1.0 * * @return ProviderAvailabilityInterface Provider availability checker. */ @@ -52,7 +52,7 @@ public static function availability(): ProviderAvailabilityInterface; /** * Gets model metadata directory. * - * @since n.e.x.t + * @since 0.1.0 * * @return ModelMetadataDirectoryInterface Model metadata directory. */ diff --git a/src/Providers/Contracts/ProviderOperationsHandlerInterface.php b/src/Providers/Contracts/ProviderOperationsHandlerInterface.php index c7123766..27238f29 100644 --- a/src/Providers/Contracts/ProviderOperationsHandlerInterface.php +++ b/src/Providers/Contracts/ProviderOperationsHandlerInterface.php @@ -14,14 +14,14 @@ * across all models within a provider. Operations are tracked at the * provider level rather than per-model. * - * @since n.e.x.t + * @since 0.1.0 */ interface ProviderOperationsHandlerInterface { /** * Gets an operation by ID. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $operationId Operation identifier. * @return OperationInterface The operation. diff --git a/src/Providers/Contracts/ProviderWithOperationsHandlerInterface.php b/src/Providers/Contracts/ProviderWithOperationsHandlerInterface.php index eaf5bf52..cc6799a8 100644 --- a/src/Providers/Contracts/ProviderWithOperationsHandlerInterface.php +++ b/src/Providers/Contracts/ProviderWithOperationsHandlerInterface.php @@ -10,14 +10,14 @@ * Providers implementing this interface can return an operations handler * for managing long-running operations across all their models. * - * @since n.e.x.t + * @since 0.1.0 */ interface ProviderWithOperationsHandlerInterface { /** * Gets the operations handler for this provider. * - * @since n.e.x.t + * @since 0.1.0 * * @return ProviderOperationsHandlerInterface The operations handler. */ diff --git a/src/Providers/DTO/ProviderMetadata.php b/src/Providers/DTO/ProviderMetadata.php index 9772a9db..fe1643ca 100644 --- a/src/Providers/DTO/ProviderMetadata.php +++ b/src/Providers/DTO/ProviderMetadata.php @@ -13,7 +13,7 @@ * This class contains information about an AI provider, including its * unique identifier, display name, and type (cloud, server, or client). * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-type ProviderMetadataArrayShape array{ * id: string, @@ -47,7 +47,7 @@ class ProviderMetadata extends AbstractDataTransferObject /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $id The provider's unique identifier. * @param string $name The provider's display name. @@ -63,7 +63,7 @@ public function __construct(string $id, string $name, ProviderTypeEnum $type) /** * Gets the provider's unique identifier. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The provider ID. */ @@ -75,7 +75,7 @@ public function getId(): string /** * Gets the provider's display name. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The provider name. */ @@ -87,7 +87,7 @@ public function getName(): string /** * Gets the provider type. * - * @since n.e.x.t + * @since 0.1.0 * * @return ProviderTypeEnum The provider type. */ @@ -99,7 +99,7 @@ public function getType(): ProviderTypeEnum /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -127,7 +127,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return ProviderMetadataArrayShape */ @@ -143,7 +143,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Providers/DTO/ProviderModelsMetadata.php b/src/Providers/DTO/ProviderModelsMetadata.php index 50f9d1eb..4b696cbd 100644 --- a/src/Providers/DTO/ProviderModelsMetadata.php +++ b/src/Providers/DTO/ProviderModelsMetadata.php @@ -14,7 +14,7 @@ * This class combines provider information with the models that * the provider offers, facilitating model discovery and selection. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-import-type ProviderMetadataArrayShape from ProviderMetadata * @phpstan-import-type ModelMetadataArrayShape from ModelMetadata @@ -44,7 +44,7 @@ class ProviderModelsMetadata extends AbstractDataTransferObject /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param ProviderMetadata $provider The provider metadata. * @param list $models The available models. @@ -64,7 +64,7 @@ public function __construct(ProviderMetadata $provider, array $models) /** * Gets the provider metadata. * - * @since n.e.x.t + * @since 0.1.0 * * @return ProviderMetadata The provider metadata. */ @@ -76,7 +76,7 @@ public function getProvider(): ProviderMetadata /** * Gets the available models. * - * @since n.e.x.t + * @since 0.1.0 * * @return list The available models. */ @@ -88,7 +88,7 @@ public function getModels(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -109,7 +109,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return ProviderModelsMetadataArrayShape */ @@ -127,7 +127,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Providers/Enums/ProviderTypeEnum.php b/src/Providers/Enums/ProviderTypeEnum.php index b1dd7c4b..6bee2f7b 100644 --- a/src/Providers/Enums/ProviderTypeEnum.php +++ b/src/Providers/Enums/ProviderTypeEnum.php @@ -9,7 +9,7 @@ /** * Enum for provider types. * - * @since n.e.x.t + * @since 0.1.0 * * @method static self cloud() Creates an instance for CLOUD type. * @method static self server() Creates an instance for SERVER type. diff --git a/src/Providers/Enums/ToolTypeEnum.php b/src/Providers/Enums/ToolTypeEnum.php index c0c999aa..61ccb409 100644 --- a/src/Providers/Enums/ToolTypeEnum.php +++ b/src/Providers/Enums/ToolTypeEnum.php @@ -9,7 +9,7 @@ /** * Enum for tool types. * - * @since n.e.x.t + * @since 0.1.0 * * @method static self functionDeclarations() Creates an instance for FUNCTION_DECLARATIONS type. * @method static self webSearch() Creates an instance for WEB_SEARCH type. diff --git a/src/Providers/Http/Collections/HeadersCollection.php b/src/Providers/Http/Collections/HeadersCollection.php index b6d0518a..9a211bbb 100644 --- a/src/Providers/Http/Collections/HeadersCollection.php +++ b/src/Providers/Http/Collections/HeadersCollection.php @@ -10,7 +10,7 @@ * This class stores HTTP headers while preserving their original casing * and provides efficient case-insensitive lookups. * - * @since n.e.x.t + * @since 0.1.0 */ class HeadersCollection { @@ -27,7 +27,7 @@ class HeadersCollection /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param array> $headers Initial headers. */ @@ -41,7 +41,7 @@ public function __construct(array $headers = []) /** * Gets a specific header value. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $name The header name (case-insensitive). * @return list|null The header value(s) or null if not found. @@ -60,7 +60,7 @@ public function get(string $name): ?array /** * Gets all headers. * - * @since n.e.x.t + * @since 0.1.0 * * @return array> All headers with their original casing. */ @@ -72,7 +72,7 @@ public function getAll(): array /** * Gets header values as a comma-separated string. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $name The header name (case-insensitive). * @return string|null The header values as a comma-separated string or null if not found. @@ -86,7 +86,7 @@ public function getAsString(string $name): ?string /** * Checks if a header exists. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $name The header name (case-insensitive). * @return bool True if the header exists, false otherwise. @@ -99,7 +99,7 @@ public function has(string $name): bool /** * Sets a header value, replacing any existing value. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $name The header name. * @param string|list $value The header value(s). @@ -131,7 +131,7 @@ private function set(string $name, $value): void /** * Returns a new instance with the specified header. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $name The header name. * @param string|list $value The header value(s). diff --git a/src/Providers/Http/Contracts/HttpTransporterInterface.php b/src/Providers/Http/Contracts/HttpTransporterInterface.php index 5450a3d5..45c8e066 100644 --- a/src/Providers/Http/Contracts/HttpTransporterInterface.php +++ b/src/Providers/Http/Contracts/HttpTransporterInterface.php @@ -13,14 +13,14 @@ * Handles sending HTTP requests and receiving responses using * PSR-7, PSR-17, and PSR-18 standards internally. * - * @since n.e.x.t + * @since 0.1.0 */ interface HttpTransporterInterface { /** * Sends an HTTP request and returns the response. * - * @since n.e.x.t + * @since 0.1.0 * * @param Request $request The request to send. * @return Response The response received. diff --git a/src/Providers/Http/Contracts/RequestAuthenticationInterface.php b/src/Providers/Http/Contracts/RequestAuthenticationInterface.php index 038481ae..055a3a77 100644 --- a/src/Providers/Http/Contracts/RequestAuthenticationInterface.php +++ b/src/Providers/Http/Contracts/RequestAuthenticationInterface.php @@ -10,7 +10,7 @@ /** * Interface for HTTP request authentication. * - * @since n.e.x.t + * @since 0.1.0 */ interface RequestAuthenticationInterface extends WithJsonSchemaInterface @@ -18,7 +18,7 @@ interface RequestAuthenticationInterface extends /** * Authenticates an HTTP request. * - * @since n.e.x.t + * @since 0.1.0 * * @param Request $request The request to authenticate. * @return Request The authenticated request. diff --git a/src/Providers/Http/Contracts/WithHttpTransporterInterface.php b/src/Providers/Http/Contracts/WithHttpTransporterInterface.php index 004c700a..4ded0767 100644 --- a/src/Providers/Http/Contracts/WithHttpTransporterInterface.php +++ b/src/Providers/Http/Contracts/WithHttpTransporterInterface.php @@ -7,14 +7,14 @@ /** * Interface for models that require HTTP transport capabilities. * - * @since n.e.x.t + * @since 0.1.0 */ interface WithHttpTransporterInterface { /** * Sets the HTTP transporter. * - * @since n.e.x.t + * @since 0.1.0 * * @param HttpTransporterInterface $transporter The HTTP transporter instance. * @return void @@ -24,7 +24,7 @@ public function setHttpTransporter(HttpTransporterInterface $transporter): void; /** * Returns the HTTP transporter. * - * @since n.e.x.t + * @since 0.1.0 * * @return HttpTransporterInterface The HTTP transporter instance. */ diff --git a/src/Providers/Http/Contracts/WithRequestAuthenticationInterface.php b/src/Providers/Http/Contracts/WithRequestAuthenticationInterface.php index 1825041b..aad63b82 100644 --- a/src/Providers/Http/Contracts/WithRequestAuthenticationInterface.php +++ b/src/Providers/Http/Contracts/WithRequestAuthenticationInterface.php @@ -7,14 +7,14 @@ /** * Interface for models that support request authentication. * - * @since n.e.x.t + * @since 0.1.0 */ interface WithRequestAuthenticationInterface { /** * Sets the request authentication. * - * @since n.e.x.t + * @since 0.1.0 * * @param RequestAuthenticationInterface $authentication The authentication instance. * @return void @@ -24,7 +24,7 @@ public function setRequestAuthentication(RequestAuthenticationInterface $authent /** * Returns the request authentication. * - * @since n.e.x.t + * @since 0.1.0 * * @return RequestAuthenticationInterface The authentication instance. */ diff --git a/src/Providers/Http/DTO/ApiKeyRequestAuthentication.php b/src/Providers/Http/DTO/ApiKeyRequestAuthentication.php index 7a726ff2..653e4df3 100644 --- a/src/Providers/Http/DTO/ApiKeyRequestAuthentication.php +++ b/src/Providers/Http/DTO/ApiKeyRequestAuthentication.php @@ -10,7 +10,7 @@ /** * Class for HTTP request authentication using an API key. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-type ApiKeyRequestAuthenticationArrayShape array{ * apiKey: string @@ -30,7 +30,7 @@ class ApiKeyRequestAuthentication extends AbstractDataTransferObject implements /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $apiKey The API key used for authentication. */ @@ -42,7 +42,7 @@ public function __construct(string $apiKey) /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function authenticateRequest(Request $request): Request { @@ -53,7 +53,7 @@ public function authenticateRequest(Request $request): Request /** * Gets the API key. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The API key. */ @@ -65,9 +65,9 @@ public function getApiKey(): string /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * - * @since n.e.x.t + * @since 0.1.0 * * @return ApiKeyRequestAuthenticationArrayShape */ @@ -81,9 +81,9 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { @@ -95,7 +95,7 @@ public static function fromArray(array $array): self /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { diff --git a/src/Providers/Http/DTO/Request.php b/src/Providers/Http/DTO/Request.php index bb015fb9..cbfd03ae 100644 --- a/src/Providers/Http/DTO/Request.php +++ b/src/Providers/Http/DTO/Request.php @@ -16,7 +16,7 @@ * This class encapsulates HTTP request data that can be converted * to PSR-7 requests by the HTTP transporter. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-type RequestArrayShape array{ * method: string, @@ -62,7 +62,7 @@ class Request extends AbstractDataTransferObject /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param HttpMethodEnum $method The HTTP method. * @param string $uri The request URI. @@ -92,7 +92,7 @@ public function __construct(HttpMethodEnum $method, string $uri, array $headers /** * Gets the HTTP method. * - * @since n.e.x.t + * @since 0.1.0 * * @return HttpMethodEnum The HTTP method. */ @@ -106,7 +106,7 @@ public function getMethod(): HttpMethodEnum * * For GET requests with array data, appends the data as query parameters. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The URI. */ @@ -124,7 +124,7 @@ public function getUri(): string /** * Gets the request headers. * - * @since n.e.x.t + * @since 0.1.0 * * @return array> The headers. */ @@ -136,7 +136,7 @@ public function getHeaders(): array /** * Gets a specific header value. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $name The header name (case-insensitive). * @return list|null The header value(s) or null if not found. @@ -149,7 +149,7 @@ public function getHeader(string $name): ?array /** * Gets header values as a comma-separated string. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $name The header name (case-insensitive). * @return string|null The header values as a comma-separated string, or null if not found. @@ -162,7 +162,7 @@ public function getHeaderAsString(string $name): ?string /** * Checks if a header exists. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $name The header name (case-insensitive). * @return bool True if the header exists, false otherwise. @@ -181,7 +181,7 @@ public function hasHeader(string $name): bool * - If data is set and Content-Type is JSON, returns JSON-encoded data * - If data is set and Content-Type is form, returns URL-encoded data * - * @since n.e.x.t + * @since 0.1.0 * * @return string|null The body. * @throws JsonException If the data cannot be encoded to JSON. @@ -217,7 +217,7 @@ public function getBody(): ?string /** * Gets the Content-Type header value. * - * @since n.e.x.t + * @since 0.1.0 * * @return string|null The Content-Type header value or null if not set. */ @@ -230,7 +230,7 @@ private function getContentType(): ?string /** * Returns a new instance with the specified header. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $name The header name. * @param string|list $value The header value(s). @@ -247,7 +247,7 @@ public function withHeader(string $name, $value): self /** * Returns a new instance with the specified data. * - * @since n.e.x.t + * @since 0.1.0 * * @param string|array $data The request data. * @return self A new instance with the data. @@ -271,7 +271,7 @@ public function withData($data): self /** * Gets the request data array. * - * @since n.e.x.t + * @since 0.1.0 * * @return array|null The request data array. */ @@ -283,7 +283,7 @@ public function getData(): ?array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -318,7 +318,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return RequestArrayShape */ @@ -342,7 +342,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Providers/Http/DTO/Response.php b/src/Providers/Http/DTO/Response.php index 8486f519..3158ce83 100644 --- a/src/Providers/Http/DTO/Response.php +++ b/src/Providers/Http/DTO/Response.php @@ -14,7 +14,7 @@ * This class encapsulates HTTP response data that has been converted * from PSR-7 responses by the HTTP transporter. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-type ResponseArrayShape array{ * statusCode: int, @@ -48,7 +48,7 @@ class Response extends AbstractDataTransferObject /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param int $statusCode The HTTP status code. * @param array> $headers The response headers. @@ -70,7 +70,7 @@ public function __construct(int $statusCode, array $headers, ?string $body = nul /** * Gets the HTTP status code. * - * @since n.e.x.t + * @since 0.1.0 * * @return int The status code. */ @@ -82,7 +82,7 @@ public function getStatusCode(): int /** * Gets the response headers. * - * @since n.e.x.t + * @since 0.1.0 * * @return array> The headers. */ @@ -94,7 +94,7 @@ public function getHeaders(): array /** * Gets a specific header value. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $name The header name (case-insensitive). * @return list|null The header value(s) or null if not found. @@ -107,7 +107,7 @@ public function getHeader(string $name): ?array /** * Gets header values as a comma-separated string. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $name The header name (case-insensitive). * @return string|null The header values as a comma-separated string or null if not found. @@ -120,7 +120,7 @@ public function getHeaderAsString(string $name): ?string /** * Gets the response body. * - * @since n.e.x.t + * @since 0.1.0 * * @return string|null The body. */ @@ -132,7 +132,7 @@ public function getBody(): ?string /** * Checks if the response has a header. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $name The header name. * @return bool True if the header exists, false otherwise. @@ -145,7 +145,7 @@ public function hasHeader(string $name): bool /** * Checks if the response indicates success. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if status code is 2xx, false otherwise. */ @@ -161,7 +161,7 @@ public function isSuccessful(): bool * Attempts to decode the body as JSON. Returns null if the body * is empty or not valid JSON. * - * @since n.e.x.t + * @since 0.1.0 * * @return array|null The decoded data or null. */ @@ -184,7 +184,7 @@ public function getData(): ?array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -217,7 +217,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return ResponseArrayShape */ @@ -238,7 +238,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Providers/Http/Enums/HttpMethodEnum.php b/src/Providers/Http/Enums/HttpMethodEnum.php index 70a038a2..8ecad16a 100644 --- a/src/Providers/Http/Enums/HttpMethodEnum.php +++ b/src/Providers/Http/Enums/HttpMethodEnum.php @@ -9,7 +9,7 @@ /** * Represents HTTP request methods. * - * @since n.e.x.t + * @since 0.1.0 * * @method static self GET() * @method static self POST() @@ -99,7 +99,7 @@ final class HttpMethodEnum extends AbstractEnum /** * Checks if this method is idempotent. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if the method is idempotent, false otherwise. */ @@ -115,7 +115,7 @@ public function isIdempotent(): bool /** * Checks if this method typically has a request body. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if the method typically has a body, false otherwise. */ diff --git a/src/Providers/Http/Exception/ResponseException.php b/src/Providers/Http/Exception/ResponseException.php index a835995a..75812bb5 100644 --- a/src/Providers/Http/Exception/ResponseException.php +++ b/src/Providers/Http/Exception/ResponseException.php @@ -9,7 +9,7 @@ /** * Exception class for HTTP response errors. * - * @since n.e.x.t + * @since 0.1.0 */ class ResponseException extends Exception { diff --git a/src/Providers/Http/HttpTransporter.php b/src/Providers/Http/HttpTransporter.php index a6950cb3..88218a1b 100644 --- a/src/Providers/Http/HttpTransporter.php +++ b/src/Providers/Http/HttpTransporter.php @@ -22,7 +22,7 @@ * objects and PSR-7 messages, using HTTPlug for client abstraction * and PSR-17 factories for message creation. * - * @since n.e.x.t + * @since 0.1.0 */ class HttpTransporter implements HttpTransporterInterface { @@ -44,7 +44,7 @@ class HttpTransporter implements HttpTransporterInterface /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param ClientInterface|null $client PSR-18 HTTP client. * @param RequestFactoryInterface|null $requestFactory PSR-17 request factory. @@ -63,7 +63,7 @@ public function __construct( /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function send(Request $request): Response { @@ -76,7 +76,7 @@ public function send(Request $request): Response /** * Converts a custom Request to a PSR-7 request. * - * @since n.e.x.t + * @since 0.1.0 * * @param Request $request The custom request. * @return RequestInterface The PSR-7 request. @@ -108,7 +108,7 @@ private function convertToPsr7Request(Request $request): RequestInterface /** * Converts a PSR-7 response to a custom Response. * - * @since n.e.x.t + * @since 0.1.0 * * @param ResponseInterface $psr7Response The PSR-7 response. * @return Response The custom response. diff --git a/src/Providers/Http/HttpTransporterFactory.php b/src/Providers/Http/HttpTransporterFactory.php index e830a88d..595396d2 100644 --- a/src/Providers/Http/HttpTransporterFactory.php +++ b/src/Providers/Http/HttpTransporterFactory.php @@ -14,7 +14,7 @@ * Uses HTTPlug's Discovery component to automatically find * available HTTP clients and factories. * - * @since n.e.x.t + * @since 0.1.0 */ class HttpTransporterFactory { @@ -24,7 +24,7 @@ class HttpTransporterFactory * Uses HTTPlug Discovery to automatically find PSR-18 client * and PSR-17 factories if not provided. * - * @since n.e.x.t + * @since 0.1.0 * * @return HttpTransporterInterface The HTTP transporter. */ diff --git a/src/Providers/Http/Traits/WithHttpTransporterTrait.php b/src/Providers/Http/Traits/WithHttpTransporterTrait.php index 12131f77..f701e8eb 100644 --- a/src/Providers/Http/Traits/WithHttpTransporterTrait.php +++ b/src/Providers/Http/Traits/WithHttpTransporterTrait.php @@ -10,7 +10,7 @@ /** * Trait for a class that implements WithHttpTransporterInterface. * - * @since n.e.x.t + * @since 0.1.0 */ trait WithHttpTransporterTrait { @@ -22,7 +22,7 @@ trait WithHttpTransporterTrait /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function setHttpTransporter(HttpTransporterInterface $httpTransporter): void { @@ -32,7 +32,7 @@ public function setHttpTransporter(HttpTransporterInterface $httpTransporter): v /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function getHttpTransporter(): HttpTransporterInterface { diff --git a/src/Providers/Http/Traits/WithRequestAuthenticationTrait.php b/src/Providers/Http/Traits/WithRequestAuthenticationTrait.php index 3f5dc2d5..9af25b31 100644 --- a/src/Providers/Http/Traits/WithRequestAuthenticationTrait.php +++ b/src/Providers/Http/Traits/WithRequestAuthenticationTrait.php @@ -10,7 +10,7 @@ /** * Trait for a class that implements WithRequestAuthenticationInterface. * - * @since n.e.x.t + * @since 0.1.0 */ trait WithRequestAuthenticationTrait { @@ -22,7 +22,7 @@ trait WithRequestAuthenticationTrait /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function setRequestAuthentication(RequestAuthenticationInterface $requestAuthentication): void { @@ -32,7 +32,7 @@ public function setRequestAuthentication(RequestAuthenticationInterface $request /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function getRequestAuthentication(): RequestAuthenticationInterface { diff --git a/src/Providers/Http/Util/ResponseUtil.php b/src/Providers/Http/Util/ResponseUtil.php index 3bde5d22..4c6f96f9 100644 --- a/src/Providers/Http/Util/ResponseUtil.php +++ b/src/Providers/Http/Util/ResponseUtil.php @@ -10,7 +10,7 @@ /** * Class with static utility methods to process HTTP responses. * - * @since n.e.x.t + * @since 0.1.0 */ class ResponseUtil { @@ -22,7 +22,7 @@ class ResponseUtil * 2xx range). It also attempts to extract a more detailed error message from * the response body if available. * - * @since n.e.x.t + * @since 0.1.0 * * @param Response $response The HTTP response to check. * @throws ResponseException If the response is not successful. diff --git a/src/Providers/Models/Contracts/ModelInterface.php b/src/Providers/Models/Contracts/ModelInterface.php index 1c6adbc7..c0a48830 100644 --- a/src/Providers/Models/Contracts/ModelInterface.php +++ b/src/Providers/Models/Contracts/ModelInterface.php @@ -14,14 +14,14 @@ * Models represent specific AI models from providers and define * their capabilities, configuration, and execution methods. * - * @since n.e.x.t + * @since 0.1.0 */ interface ModelInterface { /** * Gets model metadata. * - * @since n.e.x.t + * @since 0.1.0 * * @return ModelMetadata Model metadata. */ @@ -30,7 +30,7 @@ public function metadata(): ModelMetadata; /** * Returns the metadata for the model's provider. * - * @since n.e.x.t + * @since 0.1.0 * * @return ProviderMetadata The provider metadata. */ @@ -39,7 +39,7 @@ public function providerMetadata(): ProviderMetadata; /** * Sets model configuration. * - * @since n.e.x.t + * @since 0.1.0 * * @param ModelConfig $config Model configuration. * @return void @@ -49,7 +49,7 @@ public function setConfig(ModelConfig $config): void; /** * Gets model configuration. * - * @since n.e.x.t + * @since 0.1.0 * * @return ModelConfig Current model configuration. */ diff --git a/src/Providers/Models/DTO/ModelConfig.php b/src/Providers/Models/DTO/ModelConfig.php index e4894447..6b27d40c 100644 --- a/src/Providers/Models/DTO/ModelConfig.php +++ b/src/Providers/Models/DTO/ModelConfig.php @@ -20,7 +20,7 @@ * including output modalities, system instructions, generation parameters, * and tool integrations. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-import-type FunctionDeclarationArrayShape from FunctionDeclaration * @phpstan-import-type WebSearchArrayShape from WebSearch @@ -190,7 +190,7 @@ class ModelConfig extends AbstractDataTransferObject /** * Sets the output modalities. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $outputModalities The output modalities. * @@ -208,7 +208,7 @@ public function setOutputModalities(array $outputModalities): void /** * Gets the output modalities. * - * @since n.e.x.t + * @since 0.1.0 * * @return list|null The output modalities. */ @@ -220,7 +220,7 @@ public function getOutputModalities(): ?array /** * Sets the system instruction. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $systemInstruction The system instruction. */ @@ -232,7 +232,7 @@ public function setSystemInstruction(string $systemInstruction): void /** * Gets the system instruction. * - * @since n.e.x.t + * @since 0.1.0 * * @return string|null The system instruction. */ @@ -244,7 +244,7 @@ public function getSystemInstruction(): ?string /** * Sets the candidate count. * - * @since n.e.x.t + * @since 0.1.0 * * @param int $candidateCount The candidate count. */ @@ -256,7 +256,7 @@ public function setCandidateCount(int $candidateCount): void /** * Gets the candidate count. * - * @since n.e.x.t + * @since 0.1.0 * * @return int|null The candidate count. */ @@ -268,7 +268,7 @@ public function getCandidateCount(): ?int /** * Sets the maximum tokens. * - * @since n.e.x.t + * @since 0.1.0 * * @param int $maxTokens The maximum tokens. */ @@ -280,7 +280,7 @@ public function setMaxTokens(int $maxTokens): void /** * Gets the maximum tokens. * - * @since n.e.x.t + * @since 0.1.0 * * @return int|null The maximum tokens. */ @@ -292,7 +292,7 @@ public function getMaxTokens(): ?int /** * Sets the temperature. * - * @since n.e.x.t + * @since 0.1.0 * * @param float $temperature The temperature. */ @@ -304,7 +304,7 @@ public function setTemperature(float $temperature): void /** * Gets the temperature. * - * @since n.e.x.t + * @since 0.1.0 * * @return float|null The temperature. */ @@ -316,7 +316,7 @@ public function getTemperature(): ?float /** * Sets the top-p parameter. * - * @since n.e.x.t + * @since 0.1.0 * * @param float $topP The top-p parameter. */ @@ -328,7 +328,7 @@ public function setTopP(float $topP): void /** * Gets the top-p parameter. * - * @since n.e.x.t + * @since 0.1.0 * * @return float|null The top-p parameter. */ @@ -340,7 +340,7 @@ public function getTopP(): ?float /** * Sets the top-k parameter. * - * @since n.e.x.t + * @since 0.1.0 * * @param int $topK The top-k parameter. */ @@ -352,7 +352,7 @@ public function setTopK(int $topK): void /** * Gets the top-k parameter. * - * @since n.e.x.t + * @since 0.1.0 * * @return int|null The top-k parameter. */ @@ -364,7 +364,7 @@ public function getTopK(): ?int /** * Sets the stop sequences. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $stopSequences The stop sequences. * @@ -382,7 +382,7 @@ public function setStopSequences(array $stopSequences): void /** * Gets the stop sequences. * - * @since n.e.x.t + * @since 0.1.0 * * @return list|null The stop sequences. */ @@ -394,7 +394,7 @@ public function getStopSequences(): ?array /** * Sets the presence penalty. * - * @since n.e.x.t + * @since 0.1.0 * * @param float $presencePenalty The presence penalty. */ @@ -406,7 +406,7 @@ public function setPresencePenalty(float $presencePenalty): void /** * Gets the presence penalty. * - * @since n.e.x.t + * @since 0.1.0 * * @return float|null The presence penalty. */ @@ -418,7 +418,7 @@ public function getPresencePenalty(): ?float /** * Sets the frequency penalty. * - * @since n.e.x.t + * @since 0.1.0 * * @param float $frequencyPenalty The frequency penalty. */ @@ -430,7 +430,7 @@ public function setFrequencyPenalty(float $frequencyPenalty): void /** * Gets the frequency penalty. * - * @since n.e.x.t + * @since 0.1.0 * * @return float|null The frequency penalty. */ @@ -442,7 +442,7 @@ public function getFrequencyPenalty(): ?float /** * Sets whether to return log probabilities. * - * @since n.e.x.t + * @since 0.1.0 * * @param bool $logprobs Whether to return log probabilities. */ @@ -454,7 +454,7 @@ public function setLogprobs(bool $logprobs): void /** * Gets whether to return log probabilities. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool|null Whether to return log probabilities. */ @@ -466,7 +466,7 @@ public function getLogprobs(): ?bool /** * Sets the number of top log probabilities to return. * - * @since n.e.x.t + * @since 0.1.0 * * @param int $topLogprobs The number of top log probabilities. */ @@ -478,7 +478,7 @@ public function setTopLogprobs(int $topLogprobs): void /** * Gets the number of top log probabilities to return. * - * @since n.e.x.t + * @since 0.1.0 * * @return int|null The number of top log probabilities. */ @@ -490,7 +490,7 @@ public function getTopLogprobs(): ?int /** * Sets the function declarations. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $function_declarations The function declarations. * @@ -508,7 +508,7 @@ public function setFunctionDeclarations(array $function_declarations): void /** * Gets the function declarations. * - * @since n.e.x.t + * @since 0.1.0 * * @return list|null The function declarations. */ @@ -520,7 +520,7 @@ public function getFunctionDeclarations(): ?array /** * Sets the web search configuration. * - * @since n.e.x.t + * @since 0.1.0 * * @param WebSearch $web_search The web search configuration. */ @@ -532,7 +532,7 @@ public function setWebSearch(WebSearch $web_search): void /** * Gets the web search configuration. * - * @since n.e.x.t + * @since 0.1.0 * * @return WebSearch|null The web search configuration. */ @@ -544,7 +544,7 @@ public function getWebSearch(): ?WebSearch /** * Sets the output file type. * - * @since n.e.x.t + * @since 0.1.0 * * @param FileTypeEnum $outputFileType The output file type. */ @@ -556,7 +556,7 @@ public function setOutputFileType(FileTypeEnum $outputFileType): void /** * Gets the output file type. * - * @since n.e.x.t + * @since 0.1.0 * * @return FileTypeEnum|null The output file type. */ @@ -568,7 +568,7 @@ public function getOutputFileType(): ?FileTypeEnum /** * Sets the output MIME type. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $outputMimeType The output MIME type. */ @@ -580,7 +580,7 @@ public function setOutputMimeType(string $outputMimeType): void /** * Gets the output MIME type. * - * @since n.e.x.t + * @since 0.1.0 * * @return string|null The output MIME type. */ @@ -595,7 +595,7 @@ public function getOutputMimeType(): ?string * When setting an output schema, this method automatically sets * the output MIME type to "application/json" if not already set. * - * @since n.e.x.t + * @since 0.1.0 * * @param array $outputSchema The output schema (JSON schema). */ @@ -612,7 +612,7 @@ public function setOutputSchema(array $outputSchema): void /** * Gets the output schema. * - * @since n.e.x.t + * @since 0.1.0 * * @return array|null The output schema. */ @@ -624,7 +624,7 @@ public function getOutputSchema(): ?array /** * Sets the output media orientation. * - * @since n.e.x.t + * @since 0.1.0 * * @param MediaOrientationEnum $outputMediaOrientation The output media orientation. */ @@ -636,7 +636,7 @@ public function setOutputMediaOrientation(MediaOrientationEnum $outputMediaOrien /** * Gets the output media orientation. * - * @since n.e.x.t + * @since 0.1.0 * * @return MediaOrientationEnum|null The output media orientation. */ @@ -650,7 +650,7 @@ public function getOutputMediaOrientation(): ?MediaOrientationEnum * * If set, this supersedes the output media orientation, as it is a more specific configuration. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $outputMediaAspectRatio The output media aspect ratio (e.g. 3:2, 16:9). */ @@ -667,7 +667,7 @@ public function setOutputMediaAspectRatio(string $outputMediaAspectRatio): void /** * Gets the output media aspect ratio. * - * @since n.e.x.t + * @since 0.1.0 * * @return string|null The output media aspect ratio (e.g. 3:2, 16:9). */ @@ -679,7 +679,7 @@ public function getOutputMediaAspectRatio(): ?string /** * Sets the output speech voice. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $outputSpeechVoice The output speech voice. */ @@ -691,7 +691,7 @@ public function setOutputSpeechVoice(string $outputSpeechVoice): void /** * Gets the output speech voice. * - * @since n.e.x.t + * @since 0.1.0 * * @return string|null The output speech voice. */ @@ -703,7 +703,7 @@ public function getOutputSpeechVoice(): ?string /** * Sets a single custom option. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $key The option key. * @param mixed $value The option value. @@ -716,7 +716,7 @@ public function setCustomOption(string $key, $value): void /** * Sets the custom options. * - * @since n.e.x.t + * @since 0.1.0 * * @param array $customOptions The custom options. */ @@ -728,7 +728,7 @@ public function setCustomOptions(array $customOptions): void /** * Gets the custom options. * - * @since n.e.x.t + * @since 0.1.0 * * @return array The custom options. */ @@ -740,7 +740,7 @@ public function getCustomOptions(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -857,7 +857,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return ModelConfigArrayShape */ @@ -965,7 +965,7 @@ static function (FunctionDeclaration $function_declaration): array { /** * Converts the model configuration to required options. * - * @since n.e.x.t + * @since 0.1.0 * * @return list The required options. */ @@ -1098,7 +1098,7 @@ public function toRequiredOptions(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Providers/Models/DTO/ModelMetadata.php b/src/Providers/Models/DTO/ModelMetadata.php index 23bb335e..ecdc7bf4 100644 --- a/src/Providers/Models/DTO/ModelMetadata.php +++ b/src/Providers/Models/DTO/ModelMetadata.php @@ -14,7 +14,7 @@ * This class contains information about a specific AI model, including * its identifier, display name, supported capabilities, and configuration options. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-import-type SupportedOptionArrayShape from SupportedOption * @@ -67,7 +67,7 @@ class ModelMetadata extends AbstractDataTransferObject /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $id The model's unique identifier. * @param string $name The model's display name. @@ -105,7 +105,7 @@ public function __construct(string $id, string $name, array $supportedCapabiliti /** * Gets the model's unique identifier. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The model ID. */ @@ -117,7 +117,7 @@ public function getId(): string /** * Gets the model's display name. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The model name. */ @@ -129,7 +129,7 @@ public function getName(): string /** * Gets the model's supported capabilities. * - * @since n.e.x.t + * @since 0.1.0 * * @return list The supported capabilities. */ @@ -141,7 +141,7 @@ public function getSupportedCapabilities(): array /** * Gets the model's supported configuration options. * - * @since n.e.x.t + * @since 0.1.0 * * @return list The supported options. */ @@ -153,7 +153,7 @@ public function getSupportedOptions(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -189,7 +189,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return ModelMetadataArrayShape */ @@ -212,7 +212,7 @@ public function toArray(): array /** * Checks whether this model meets the specified requirements. * - * @since n.e.x.t + * @since 0.1.0 * * @param ModelRequirements $requirements The requirements to check against. * @return bool True if the model meets all requirements, false otherwise. @@ -248,7 +248,7 @@ public function meetsRequirements(ModelRequirements $requirements): bool /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Providers/Models/DTO/ModelRequirements.php b/src/Providers/Models/DTO/ModelRequirements.php index fca6dedd..fc8e37d4 100644 --- a/src/Providers/Models/DTO/ModelRequirements.php +++ b/src/Providers/Models/DTO/ModelRequirements.php @@ -14,7 +14,7 @@ * This class defines the capabilities and options that a model must support * in order to be considered suitable for the implementing code's needs. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-import-type RequiredOptionArrayShape from RequiredOption * @@ -43,7 +43,7 @@ class ModelRequirements extends AbstractDataTransferObject /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $requiredCapabilities The capabilities that the model must support. * @param list $requiredOptions The options that the model must support with specific values. @@ -67,7 +67,7 @@ public function __construct(array $requiredCapabilities, array $requiredOptions) /** * Gets the capabilities that the model must support. * - * @since n.e.x.t + * @since 0.1.0 * * @return list The required capabilities. */ @@ -79,7 +79,7 @@ public function getRequiredCapabilities(): array /** * Gets the options that the model must support with specific values. * - * @since n.e.x.t + * @since 0.1.0 * * @return list The required options. */ @@ -91,7 +91,7 @@ public function getRequiredOptions(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -119,7 +119,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return ModelRequirementsArrayShape */ @@ -140,7 +140,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Providers/Models/DTO/RequiredOption.php b/src/Providers/Models/DTO/RequiredOption.php index d7d26291..deef7bc6 100644 --- a/src/Providers/Models/DTO/RequiredOption.php +++ b/src/Providers/Models/DTO/RequiredOption.php @@ -13,7 +13,7 @@ * This class defines an option that the model must support with a specific value * for it to be considered suitable for the implementing code's requirements. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-type RequiredOptionArrayShape array{ * name: string, @@ -40,7 +40,7 @@ class RequiredOption extends AbstractDataTransferObject /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param OptionEnum $name The option name. * @param mixed $value The value that the model must support for this option. @@ -54,7 +54,7 @@ public function __construct(OptionEnum $name, $value) /** * Gets the option name. * - * @since n.e.x.t + * @since 0.1.0 * * @return OptionEnum The option name. */ @@ -66,7 +66,7 @@ public function getName(): OptionEnum /** * Gets the value that the model must support for this option. * - * @since n.e.x.t + * @since 0.1.0 * * @return mixed The value that the model must support. */ @@ -78,7 +78,7 @@ public function getValue() /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -109,7 +109,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return RequiredOptionArrayShape */ @@ -124,7 +124,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Providers/Models/DTO/SupportedOption.php b/src/Providers/Models/DTO/SupportedOption.php index e9291b37..e1ff0eb0 100644 --- a/src/Providers/Models/DTO/SupportedOption.php +++ b/src/Providers/Models/DTO/SupportedOption.php @@ -14,7 +14,7 @@ * This class defines an option that a model supports, including its name * and the values that are valid for that option. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-type SupportedOptionArrayShape array{ * name: string, @@ -41,7 +41,7 @@ class SupportedOption extends AbstractDataTransferObject /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param OptionEnum $name The option name. * @param list|null $supportedValues The supported values for this option, or null if any value is supported. @@ -61,7 +61,7 @@ public function __construct(OptionEnum $name, ?array $supportedValues = null) /** * Gets the option name. * - * @since n.e.x.t + * @since 0.1.0 * * @return OptionEnum The option name. */ @@ -73,7 +73,7 @@ public function getName(): OptionEnum /** * Checks if a value is supported for this option. * - * @since n.e.x.t + * @since 0.1.0 * * @param mixed $value The value to check. * @return bool True if the value is supported, false otherwise. @@ -106,7 +106,7 @@ public function isSupportedValue($value): bool /** * Gets the supported values for this option. * - * @since n.e.x.t + * @since 0.1.0 * * @return list|null The supported values, or null if any value is supported. */ @@ -118,7 +118,7 @@ public function getSupportedValues(): ?array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -152,7 +152,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return SupportedOptionArrayShape */ @@ -174,7 +174,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Providers/Models/Enums/CapabilityEnum.php b/src/Providers/Models/Enums/CapabilityEnum.php index 68a8c867..43fc8403 100644 --- a/src/Providers/Models/Enums/CapabilityEnum.php +++ b/src/Providers/Models/Enums/CapabilityEnum.php @@ -9,7 +9,7 @@ /** * Enum for model capabilities. * - * @since n.e.x.t + * @since 0.1.0 * * @method static self textGeneration() Creates an instance for TEXT_GENERATION capability. * @method static self imageGeneration() Creates an instance for IMAGE_GENERATION capability. diff --git a/src/Providers/Models/Enums/OptionEnum.php b/src/Providers/Models/Enums/OptionEnum.php index 2d775686..27b2248f 100644 --- a/src/Providers/Models/Enums/OptionEnum.php +++ b/src/Providers/Models/Enums/OptionEnum.php @@ -62,7 +62,7 @@ * @method bool isTopP() Checks if the option is TOP_P. * @method bool isWebSearch() Checks if the option is WEB_SEARCH. * - * @since n.e.x.t + * @since 0.1.0 */ class OptionEnum extends AbstractEnum { @@ -81,7 +81,7 @@ class OptionEnum extends AbstractEnum * that are prefixed with KEY_. These are transformed to remove the KEY_ prefix * and converted to snake_case values. * - * @since n.e.x.t + * @since 0.1.0 * * @param class-string $className The fully qualified class name. * @return array The enum constants. diff --git a/src/Providers/Models/ImageGeneration/Contracts/ImageGenerationModelInterface.php b/src/Providers/Models/ImageGeneration/Contracts/ImageGenerationModelInterface.php index 0cc4997c..d098a0d6 100644 --- a/src/Providers/Models/ImageGeneration/Contracts/ImageGenerationModelInterface.php +++ b/src/Providers/Models/ImageGeneration/Contracts/ImageGenerationModelInterface.php @@ -12,14 +12,14 @@ * * Provides synchronous methods for generating images from text prompts. * - * @since n.e.x.t + * @since 0.1.0 */ interface ImageGenerationModelInterface { /** * Generates images from a prompt. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $prompt Array of messages containing the image generation prompt. * @return GenerativeAiResult Result containing generated images. diff --git a/src/Providers/Models/ImageGeneration/Contracts/ImageGenerationOperationModelInterface.php b/src/Providers/Models/ImageGeneration/Contracts/ImageGenerationOperationModelInterface.php index 735fb1c3..00253770 100644 --- a/src/Providers/Models/ImageGeneration/Contracts/ImageGenerationOperationModelInterface.php +++ b/src/Providers/Models/ImageGeneration/Contracts/ImageGenerationOperationModelInterface.php @@ -12,14 +12,14 @@ * * Provides methods for initiating long-running image generation tasks. * - * @since n.e.x.t + * @since 0.1.0 */ interface ImageGenerationOperationModelInterface { /** * Creates an image generation operation. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $prompt Array of messages containing the image generation prompt. * @return GenerativeAiOperation The initiated image generation operation. diff --git a/src/Providers/Models/SpeechGeneration/Contracts/SpeechGenerationModelInterface.php b/src/Providers/Models/SpeechGeneration/Contracts/SpeechGenerationModelInterface.php index d17a6752..ae1be1ed 100644 --- a/src/Providers/Models/SpeechGeneration/Contracts/SpeechGenerationModelInterface.php +++ b/src/Providers/Models/SpeechGeneration/Contracts/SpeechGenerationModelInterface.php @@ -12,14 +12,14 @@ * * Provides synchronous methods for generating speech from prompts. * - * @since n.e.x.t + * @since 0.1.0 */ interface SpeechGenerationModelInterface { /** * Generates speech from a prompt. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $prompt Array of messages containing the speech generation prompt. * @return GenerativeAiResult Result containing generated speech audio. diff --git a/src/Providers/Models/SpeechGeneration/Contracts/SpeechGenerationOperationModelInterface.php b/src/Providers/Models/SpeechGeneration/Contracts/SpeechGenerationOperationModelInterface.php index 3f157368..189f5d98 100644 --- a/src/Providers/Models/SpeechGeneration/Contracts/SpeechGenerationOperationModelInterface.php +++ b/src/Providers/Models/SpeechGeneration/Contracts/SpeechGenerationOperationModelInterface.php @@ -12,14 +12,14 @@ * * Provides methods for initiating long-running speech generation tasks. * - * @since n.e.x.t + * @since 0.1.0 */ interface SpeechGenerationOperationModelInterface { /** * Creates a speech generation operation. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $prompt Array of messages containing the speech generation prompt. * @return GenerativeAiOperation The initiated speech generation operation. diff --git a/src/Providers/Models/TextGeneration/Contracts/TextGenerationModelInterface.php b/src/Providers/Models/TextGeneration/Contracts/TextGenerationModelInterface.php index cc36c103..3a8c3354 100644 --- a/src/Providers/Models/TextGeneration/Contracts/TextGenerationModelInterface.php +++ b/src/Providers/Models/TextGeneration/Contracts/TextGenerationModelInterface.php @@ -13,14 +13,14 @@ * * Provides synchronous and streaming methods for generating text from prompts. * - * @since n.e.x.t + * @since 0.1.0 */ interface TextGenerationModelInterface { /** * Generates text from a prompt. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $prompt Array of messages containing the text generation prompt. * @return GenerativeAiResult Result containing generated text. @@ -30,7 +30,7 @@ public function generateTextResult(array $prompt): GenerativeAiResult; /** * Streams text generation from a prompt. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $prompt Array of messages containing the text generation prompt. * @return Generator Generator yielding partial results. diff --git a/src/Providers/Models/TextGeneration/Contracts/TextGenerationOperationModelInterface.php b/src/Providers/Models/TextGeneration/Contracts/TextGenerationOperationModelInterface.php index ee019b36..4fd305a0 100644 --- a/src/Providers/Models/TextGeneration/Contracts/TextGenerationOperationModelInterface.php +++ b/src/Providers/Models/TextGeneration/Contracts/TextGenerationOperationModelInterface.php @@ -12,14 +12,14 @@ * * Provides methods for initiating long-running text generation tasks. * - * @since n.e.x.t + * @since 0.1.0 */ interface TextGenerationOperationModelInterface { /** * Creates a text generation operation. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $prompt Array of messages containing the text generation prompt. * @return GenerativeAiOperation The initiated text generation operation. diff --git a/src/Providers/Models/TextToSpeechConversion/Contracts/TextToSpeechConversionModelInterface.php b/src/Providers/Models/TextToSpeechConversion/Contracts/TextToSpeechConversionModelInterface.php index 5d39c096..ea7eda09 100644 --- a/src/Providers/Models/TextToSpeechConversion/Contracts/TextToSpeechConversionModelInterface.php +++ b/src/Providers/Models/TextToSpeechConversion/Contracts/TextToSpeechConversionModelInterface.php @@ -12,14 +12,14 @@ * * Provides synchronous methods for converting text to speech audio. * - * @since n.e.x.t + * @since 0.1.0 */ interface TextToSpeechConversionModelInterface { /** * Converts text to speech. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $prompt Array of messages containing the text to convert to speech. * @return GenerativeAiResult Result containing generated speech audio. diff --git a/src/Providers/Models/TextToSpeechConversion/Contracts/TextToSpeechConversionOperationModelInterface.php b/src/Providers/Models/TextToSpeechConversion/Contracts/TextToSpeechConversionOperationModelInterface.php index 8ca181e1..aeb53fd9 100644 --- a/src/Providers/Models/TextToSpeechConversion/Contracts/TextToSpeechConversionOperationModelInterface.php +++ b/src/Providers/Models/TextToSpeechConversion/Contracts/TextToSpeechConversionOperationModelInterface.php @@ -12,14 +12,14 @@ * * Provides methods for initiating long-running text-to-speech conversion tasks. * - * @since n.e.x.t + * @since 0.1.0 */ interface TextToSpeechConversionOperationModelInterface { /** * Creates a text-to-speech conversion operation. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $prompt Array of messages containing the text to convert to speech. * @return GenerativeAiOperation The initiated text-to-speech conversion operation. diff --git a/src/Providers/OpenAiCompatibleImplementation/AbstractOpenAiCompatibleImageGenerationModel.php b/src/Providers/OpenAiCompatibleImplementation/AbstractOpenAiCompatibleImageGenerationModel.php index c61f4160..7200fa3f 100644 --- a/src/Providers/OpenAiCompatibleImplementation/AbstractOpenAiCompatibleImageGenerationModel.php +++ b/src/Providers/OpenAiCompatibleImplementation/AbstractOpenAiCompatibleImageGenerationModel.php @@ -26,7 +26,7 @@ /** * Base class for an image generation model for an OpenAI compatible provider. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-type ChoiceData array{ * url?: string, @@ -79,7 +79,7 @@ public function generateImageResult(array $prompt): GenerativeAiResult /** * Prepares the given prompt and the model configuration into parameters for the API request. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $prompt The prompt to generate an image for. Either a single message or a list of messages * from a chat. However as of today, OpenAI compatible image generation endpoints only @@ -142,7 +142,7 @@ protected function prepareGenerateImageParams(array $prompt): array /** * Prepares the prompt parameter for the API request. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $messages The messages to prepare. However as of today, OpenAI compatible image generation * endpoints only support a single user message. @@ -182,7 +182,7 @@ protected function preparePromptParam(array $messages): string /** * Prepares the size parameter for the API request. * - * @since n.e.x.t + * @since 0.1.0 * * @param MediaOrientationEnum|null $orientation The desired media orientation. * @param string|null $aspectRatio The desired media aspect ratio. @@ -245,7 +245,7 @@ protected function prepareSizeParam(?MediaOrientationEnum $orientation, ?string /** * Creates a request object for the provider's API. * - * @since n.e.x.t + * @since 0.1.0 * * @param HttpMethodEnum $method The HTTP method. * @param string $path The API endpoint path, relative to the base URI. @@ -263,7 +263,7 @@ abstract protected function createRequest( /** * Throws an exception if the response is not successful. * - * @since n.e.x.t + * @since 0.1.0 * * @param Response $response The HTTP response to check. * @throws ResponseException If the response is not successful. @@ -280,7 +280,7 @@ protected function throwIfNotSuccessful(Response $response): void /** * Parses the response from the API endpoint to a generative AI result. * - * @since n.e.x.t + * @since 0.1.0 * * @param Response $response The response from the API endpoint. * @param string $expectedMimeType The expected MIME type the response is in. @@ -345,7 +345,7 @@ protected function parseResponseToGenerativeAiResult( /** * Parses a single choice from the API response into a Candidate object. * - * @since n.e.x.t + * @since 0.1.0 * * @param ChoiceData $choiceData The choice data from the API response. * @param string $expectedMimeType The expected MIME type the response is in. diff --git a/src/Providers/OpenAiCompatibleImplementation/AbstractOpenAiCompatibleModelMetadataDirectory.php b/src/Providers/OpenAiCompatibleImplementation/AbstractOpenAiCompatibleModelMetadataDirectory.php index a267eeeb..c1bda19b 100644 --- a/src/Providers/OpenAiCompatibleImplementation/AbstractOpenAiCompatibleModelMetadataDirectory.php +++ b/src/Providers/OpenAiCompatibleImplementation/AbstractOpenAiCompatibleModelMetadataDirectory.php @@ -15,14 +15,14 @@ /** * Base class for a model metadata directory for an OpenAI compatible provider. * - * @since n.e.x.t + * @since 0.1.0 */ abstract class AbstractOpenAiCompatibleModelMetadataDirectory extends AbstractApiBasedModelMetadataDirectory { /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ protected function sendListModelsRequest(): array { @@ -46,7 +46,7 @@ protected function sendListModelsRequest(): array /** * Creates a request object for the provider's API. * - * @since n.e.x.t + * @since 0.1.0 * * @param HttpMethodEnum $method The HTTP method. * @param string $path The API endpoint path, relative to the base URI. @@ -64,7 +64,7 @@ abstract protected function createRequest( /** * Throws an exception if the response is not successful. * - * @since n.e.x.t + * @since 0.1.0 * * @param Response $response The HTTP response to check. * @throws ResponseException If the response is not successful. @@ -81,7 +81,7 @@ protected function throwIfNotSuccessful(Response $response): void /** * Parses the response from the API endpoint to list models into a list of model metadata objects. * - * @since n.e.x.t + * @since 0.1.0 * * @param Response $response The response from the API endpoint to list models. * @return list List of model metadata objects. diff --git a/src/Providers/OpenAiCompatibleImplementation/AbstractOpenAiCompatibleTextGenerationModel.php b/src/Providers/OpenAiCompatibleImplementation/AbstractOpenAiCompatibleTextGenerationModel.php index d0df3476..f48fac24 100644 --- a/src/Providers/OpenAiCompatibleImplementation/AbstractOpenAiCompatibleTextGenerationModel.php +++ b/src/Providers/OpenAiCompatibleImplementation/AbstractOpenAiCompatibleTextGenerationModel.php @@ -29,7 +29,7 @@ /** * Base class for a text generation model for an OpenAI compatible provider. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-type ToolCallData array{ * type?: string, @@ -66,7 +66,7 @@ abstract class AbstractOpenAiCompatibleTextGenerationModel extends AbstractApiBa /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ final public function generateTextResult(array $prompt): GenerativeAiResult { @@ -93,7 +93,7 @@ final public function generateTextResult(array $prompt): GenerativeAiResult /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ final public function streamGenerateTextResult(array $prompt): Generator { @@ -108,7 +108,7 @@ final public function streamGenerateTextResult(array $prompt): Generator /** * Prepares the given prompt and the model configuration into parameters for the API request. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $prompt The prompt to generate text for. Either a single message or a list of messages * from a chat. @@ -210,7 +210,7 @@ protected function prepareGenerateTextParams(array $prompt): array /** * Prepares the messages parameter for the API request. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $messages The messages to prepare. * @param string|null $systemInstruction An optional system instruction to prepend to the messages. @@ -276,7 +276,7 @@ function (Message $message): array { /** * Returns the OpenAI API specific role string for the given message role. * - * @since n.e.x.t + * @since 0.1.0 * * @param MessageRoleEnum $role The message role. * @return string The role for the API request. @@ -292,7 +292,7 @@ protected function getMessageRoleString(MessageRoleEnum $role): string /** * Returns the OpenAI API specific content data for a message part. * - * @since n.e.x.t + * @since 0.1.0 * * @param MessagePart $part The message part to get the data for. * @return ?array The data for the message content part, or null if not applicable. @@ -377,7 +377,7 @@ protected function getMessagePartContentData(MessagePart $part): ?array /** * Returns the OpenAI API specific tool calls data for a message part. * - * @since n.e.x.t + * @since 0.1.0 * * @param MessagePart $part The message part to get the data for. * @return ?array The data for the message tool call part, or null if not applicable. @@ -410,7 +410,7 @@ protected function getMessagePartToolCallData(MessagePart $part): ?array /** * Validates that the given output modalities to ensure that at least one output modality is text. * - * @since n.e.x.t + * @since 0.1.0 * * @param array $outputModalities The output modalities to validate. * @throws InvalidArgumentException If no text output modality is present. @@ -436,7 +436,7 @@ protected function validateOutputModalities(array $outputModalities): void /** * Prepares the output modalities parameter for the API request. * - * @since n.e.x.t + * @since 0.1.0 * * @param array $modalities The modalities to prepare. * @return list The prepared modalities parameter. @@ -466,7 +466,7 @@ protected function prepareOutputModalitiesParam(array $modalities): array /** * Prepares the tools parameter for the API request. * - * @since n.e.x.t + * @since 0.1.0 * * @param list $functionDeclarations The function declarations. * @return list> The prepared tools parameter. @@ -489,7 +489,7 @@ protected function prepareToolsParam(array $functionDeclarations): array * * This is only called if the output MIME type is `application/json`. * - * @since n.e.x.t + * @since 0.1.0 * * @param array|null $outputSchema The output schema. * @return array The prepared response format parameter. @@ -511,7 +511,7 @@ protected function prepareResponseFormatParam(?array $outputSchema): array /** * Creates a request object for the provider's API. * - * @since n.e.x.t + * @since 0.1.0 * * @param HttpMethodEnum $method The HTTP method. * @param string $path The API endpoint path, relative to the base URI. @@ -529,7 +529,7 @@ abstract protected function createRequest( /** * Throws an exception if the response is not successful. * - * @since n.e.x.t + * @since 0.1.0 * * @param Response $response The HTTP response to check. * @throws ResponseException If the response is not successful. @@ -546,7 +546,7 @@ protected function throwIfNotSuccessful(Response $response): void /** * Parses the response from the API endpoint to a generative AI result. * - * @since n.e.x.t + * @since 0.1.0 * * @param Response $response The response from the API endpoint. * @return GenerativeAiResult The parsed generative AI result. @@ -608,7 +608,7 @@ protected function parseResponseToGenerativeAiResult(Response $response): Genera /** * Parses a single choice from the API response into a Candidate object. * - * @since n.e.x.t + * @since 0.1.0 * * @param ChoiceData $choiceData The choice data from the API response. * @return Candidate The parsed candidate. @@ -663,7 +663,7 @@ protected function parseResponseChoiceToCandidate(array $choiceData): Candidate /** * Parses the message from a choice in the API response. * - * @since n.e.x.t + * @since 0.1.0 * * @param MessageData $messageData The message data from the API response. * @return Message The parsed message. @@ -682,7 +682,7 @@ protected function parseResponseChoiceMessage(array $messageData): Message /** * Parses the message parts from a choice in the API response. * - * @since n.e.x.t + * @since 0.1.0 * * @param MessageData $messageData The message data from the API response. * @return MessagePart[] The parsed message parts. @@ -717,7 +717,7 @@ protected function parseResponseChoiceMessageParts(array $messageData): array /** * Parses a tool call part from the API response. * - * @since n.e.x.t + * @since 0.1.0 * * @param ToolCallData $toolCallData The tool call data from the API response. * @return MessagePart|null The parsed message part for the tool call, or null if not applicable. diff --git a/src/Providers/ProviderRegistry.php b/src/Providers/ProviderRegistry.php index ff352714..2ee3ef13 100644 --- a/src/Providers/ProviderRegistry.php +++ b/src/Providers/ProviderRegistry.php @@ -27,7 +27,7 @@ * This class provides a centralized way to register AI providers, discover * their capabilities, and find suitable models based on requirements. * - * @since n.e.x.t + * @since 0.1.0 */ class ProviderRegistry implements WithHttpTransporterInterface { @@ -54,7 +54,7 @@ class ProviderRegistry implements WithHttpTransporterInterface /** * Registers a provider class with the registry. * - * @since n.e.x.t + * @since 0.1.0 * * @param class-string $className The fully qualified provider class name implementing the * ProviderInterface @@ -116,7 +116,7 @@ public function registerProvider(string $className): void /** * Checks if a provider is registered. * - * @since n.e.x.t + * @since 0.1.0 * * @param string|class-string $idOrClassName The provider ID or class name to check. * @return bool True if the provider is registered. @@ -130,7 +130,7 @@ public function hasProvider(string $idOrClassName): bool /** * Gets the class name for a registered provider. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $id The provider ID. * @return string The provider class name. @@ -150,7 +150,7 @@ public function getProviderClassName(string $id): string /** * Checks if a provider is properly configured. * - * @since n.e.x.t + * @since 0.1.0 * * @param string|class-string $idOrClassName The provider ID or class name. * @return bool True if the provider is configured and ready to use. @@ -173,7 +173,7 @@ public function isProviderConfigured(string $idOrClassName): bool /** * Finds models across all available providers that support the given requirements. * - * @since n.e.x.t + * @since 0.1.0 * * @param ModelRequirements $modelRequirements The requirements to match against. * @return list List of provider models metadata that match requirements. @@ -202,7 +202,7 @@ public function findModelsMetadataForSupport(ModelRequirements $modelRequirement /** * Finds models within a specific available provider that support the given requirements. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $idOrClassName The provider ID or class name. * @param ModelRequirements $modelRequirements The requirements to match against. @@ -235,7 +235,7 @@ public function findProviderModelsMetadataForSupport( /** * Gets a configured model instance from a provider. * - * @since n.e.x.t + * @since 0.1.0 * * @param string|class-string $idOrClassName The provider ID or class name. * @param string $modelId The model identifier. @@ -263,7 +263,7 @@ public function getProviderModel( * This method injects required dependencies such as HTTP transporter * and authentication into model instances that need them. * - * @since n.e.x.t + * @since 0.1.0 * * @param ModelInterface $modelInstance The model instance to bind dependencies to. * @return void @@ -309,7 +309,7 @@ private function resolveProviderClassName(string $idOrClassName): string /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function setHttpTransporter(HttpTransporterInterface $httpTransporter): void { @@ -324,7 +324,7 @@ public function setHttpTransporter(HttpTransporterInterface $httpTransporter): v /** * Sets the request authentication instance for the given provider. * - * @since n.e.x.t + * @since 0.1.0 * * @param string|class-string $idOrClassName The provider ID or class name. * @param RequestAuthenticationInterface $requestAuthentication The request authentication instance. @@ -343,7 +343,7 @@ public function setProviderRequestAuthentication( /** * Gets the request authentication instance for the given provider, if set. * - * @since n.e.x.t + * @since 0.1.0 * * @param string|class-string $idOrClassName The provider ID or class name. * @return ?RequestAuthenticationInterface The request authentication instance, or null if not set. @@ -360,7 +360,7 @@ public function getProviderRequestAuthentication(string $idOrClassName): ?Reques /** * Sets the HTTP transporter for a specific provider, hooking up its class instances. * - * @since n.e.x.t + * @since 0.1.0 * * @param class-string $className The provider class name. * @param HttpTransporterInterface $httpTransporter The HTTP transporter instance. @@ -390,7 +390,7 @@ private function setHttpTransporterForProvider( /** * Sets the request authentication for a specific provider, hooking up its class instances. * - * @since n.e.x.t + * @since 0.1.0 * * @param class-string $className The provider class name. * @param RequestAuthenticationInterface $requestAuthentication The authentication instance. @@ -420,7 +420,7 @@ private function setRequestAuthenticationForProvider( /** * Creates a default request authentication instance for a provider. * - * @since n.e.x.t + * @since 0.1.0 * * @param class-string $className The provider class name. * @return ?RequestAuthenticationInterface The default request authentication instance, or null if not required or @@ -492,7 +492,7 @@ private function createDefaultProviderRequestAuthentication( /** * Converts a provider ID and field name to a constant case environment variable name. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $providerId The provider ID. * @param string $field The field name. diff --git a/src/Results/Contracts/ResultInterface.php b/src/Results/Contracts/ResultInterface.php index c1965c20..a29386a9 100644 --- a/src/Results/Contracts/ResultInterface.php +++ b/src/Results/Contracts/ResultInterface.php @@ -14,14 +14,14 @@ * Results contain the output from AI operations along with metadata * such as token usage and provider-specific information. * - * @since n.e.x.t + * @since 0.1.0 */ interface ResultInterface { /** * Gets the result ID. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The unique result identifier. */ @@ -30,7 +30,7 @@ public function getId(): string; /** * Gets token usage information. * - * @since n.e.x.t + * @since 0.1.0 * * @return TokenUsage Token usage statistics. */ @@ -39,7 +39,7 @@ public function getTokenUsage(): TokenUsage; /** * Gets the provider metadata. * - * @since n.e.x.t + * @since 0.1.0 * * @return ProviderMetadata The provider metadata. */ @@ -48,7 +48,7 @@ public function getProviderMetadata(): ProviderMetadata; /** * Gets the model metadata. * - * @since n.e.x.t + * @since 0.1.0 * * @return ModelMetadata The model metadata. */ @@ -57,7 +57,7 @@ public function getModelMetadata(): ModelMetadata; /** * Gets provider-specific metadata. * - * @since n.e.x.t + * @since 0.1.0 * * @return array Provider metadata. */ diff --git a/src/Results/DTO/Candidate.php b/src/Results/DTO/Candidate.php index 3c5e6a95..20ee3475 100644 --- a/src/Results/DTO/Candidate.php +++ b/src/Results/DTO/Candidate.php @@ -15,7 +15,7 @@ * When generating content, AI models can produce multiple candidates. * Each candidate contains a message and metadata about why generation stopped. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-import-type MessageArrayShape from Message * @@ -40,7 +40,7 @@ class Candidate extends AbstractDataTransferObject /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param Message $message The generated message. * @param FinishReasonEnum $finishReason The reason generation stopped. @@ -60,7 +60,7 @@ public function __construct(Message $message, FinishReasonEnum $finishReason) /** * Gets the generated message. * - * @since n.e.x.t + * @since 0.1.0 * * @return Message The message. */ @@ -72,7 +72,7 @@ public function getMessage(): Message /** * Gets the finish reason. * - * @since n.e.x.t + * @since 0.1.0 * * @return FinishReasonEnum The finish reason. */ @@ -84,7 +84,7 @@ public function getFinishReason(): FinishReasonEnum /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -105,7 +105,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return CandidateArrayShape */ @@ -120,7 +120,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Results/DTO/GenerativeAiResult.php b/src/Results/DTO/GenerativeAiResult.php index c8925fad..4102ec38 100644 --- a/src/Results/DTO/GenerativeAiResult.php +++ b/src/Results/DTO/GenerativeAiResult.php @@ -19,7 +19,7 @@ * This DTO contains the generated candidates along with usage statistics * and metadata from the AI provider. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-import-type CandidateArrayShape from Candidate * @phpstan-import-type TokenUsageArrayShape from TokenUsage @@ -78,7 +78,7 @@ class GenerativeAiResult extends AbstractDataTransferObject implements ResultInt /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $id Unique identifier for this result. * @param Candidate[] $candidates The generated candidates. @@ -111,7 +111,7 @@ public function __construct( /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function getId(): string { @@ -121,7 +121,7 @@ public function getId(): string /** * Gets the generated candidates. * - * @since n.e.x.t + * @since 0.1.0 * * @return Candidate[] The candidates. */ @@ -133,7 +133,7 @@ public function getCandidates(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function getTokenUsage(): TokenUsage { @@ -143,7 +143,7 @@ public function getTokenUsage(): TokenUsage /** * Gets the provider metadata. * - * @since n.e.x.t + * @since 0.1.0 * * @return ProviderMetadata The provider metadata. */ @@ -155,7 +155,7 @@ public function getProviderMetadata(): ProviderMetadata /** * Gets the model metadata. * - * @since n.e.x.t + * @since 0.1.0 * * @return ModelMetadata The model metadata. */ @@ -167,7 +167,7 @@ public function getModelMetadata(): ModelMetadata /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public function getAdditionalData(): array { @@ -177,7 +177,7 @@ public function getAdditionalData(): array /** * Gets the total number of candidates. * - * @since n.e.x.t + * @since 0.1.0 * * @return int The total number of candidates. */ @@ -189,7 +189,7 @@ public function getCandidateCount(): int /** * Checks if the result has multiple candidates. * - * @since n.e.x.t + * @since 0.1.0 * * @return bool True if there are multiple candidates, false otherwise. */ @@ -201,7 +201,7 @@ public function hasMultipleCandidates(): bool /** * Converts the first candidate to text. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The text content. * @throws RuntimeException If no text content. @@ -222,7 +222,7 @@ public function toText(): string /** * Converts the first candidate to a file. * - * @since n.e.x.t + * @since 0.1.0 * * @return File The file. * @throws RuntimeException If no file content. @@ -243,7 +243,7 @@ public function toFile(): File /** * Converts the first candidate to an image file. * - * @since n.e.x.t + * @since 0.1.0 * * @return File The image file. * @throws RuntimeException If no image content. @@ -264,7 +264,7 @@ public function toImageFile(): File /** * Converts the first candidate to an audio file. * - * @since n.e.x.t + * @since 0.1.0 * * @return File The audio file. * @throws RuntimeException If no audio content. @@ -285,7 +285,7 @@ public function toAudioFile(): File /** * Converts the first candidate to a video file. * - * @since n.e.x.t + * @since 0.1.0 * * @return File The video file. * @throws RuntimeException If no video content. @@ -306,7 +306,7 @@ public function toVideoFile(): File /** * Converts the first candidate to a message. * - * @since n.e.x.t + * @since 0.1.0 * * @return Message The message. */ @@ -318,7 +318,7 @@ public function toMessage(): Message /** * Converts all candidates to text array. * - * @since n.e.x.t + * @since 0.1.0 * * @return list Array of text content. */ @@ -341,7 +341,7 @@ public function toTexts(): array /** * Converts all candidates to files. * - * @since n.e.x.t + * @since 0.1.0 * * @return list Array of files. */ @@ -364,7 +364,7 @@ public function toFiles(): array /** * Converts all candidates to image files. * - * @since n.e.x.t + * @since 0.1.0 * * @return list Array of image files. */ @@ -379,7 +379,7 @@ public function toImageFiles(): array /** * Converts all candidates to audio files. * - * @since n.e.x.t + * @since 0.1.0 * * @return list Array of audio files. */ @@ -394,7 +394,7 @@ public function toAudioFiles(): array /** * Converts all candidates to video files. * - * @since n.e.x.t + * @since 0.1.0 * * @return list Array of video files. */ @@ -409,7 +409,7 @@ public function toVideoFiles(): array /** * Converts all candidates to messages. * - * @since n.e.x.t + * @since 0.1.0 * * @return list Array of messages. */ @@ -421,7 +421,7 @@ public function toMessages(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -460,7 +460,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return GenerativeAiResultArrayShape */ @@ -479,7 +479,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Results/DTO/TokenUsage.php b/src/Results/DTO/TokenUsage.php index 334fb939..4e283085 100644 --- a/src/Results/DTO/TokenUsage.php +++ b/src/Results/DTO/TokenUsage.php @@ -12,7 +12,7 @@ * This DTO tracks the number of tokens used in prompts and completions, * which is important for monitoring usage and costs. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-type TokenUsageArrayShape array{ * promptTokens: int, @@ -45,7 +45,7 @@ class TokenUsage extends AbstractDataTransferObject /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param int $promptTokens Number of tokens in the prompt. * @param int $completionTokens Number of tokens in the completion. @@ -61,7 +61,7 @@ public function __construct(int $promptTokens, int $completionTokens, int $total /** * Gets the number of prompt tokens. * - * @since n.e.x.t + * @since 0.1.0 * * @return int The prompt token count. */ @@ -73,7 +73,7 @@ public function getPromptTokens(): int /** * Gets the number of completion tokens. * - * @since n.e.x.t + * @since 0.1.0 * * @return int The completion token count. */ @@ -85,7 +85,7 @@ public function getCompletionTokens(): int /** * Gets the total number of tokens. * - * @since n.e.x.t + * @since 0.1.0 * * @return int The total token count. */ @@ -97,7 +97,7 @@ public function getTotalTokens(): int /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -124,7 +124,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return TokenUsageArrayShape */ @@ -140,7 +140,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Results/Enums/FinishReasonEnum.php b/src/Results/Enums/FinishReasonEnum.php index bacf403f..e9e45d67 100644 --- a/src/Results/Enums/FinishReasonEnum.php +++ b/src/Results/Enums/FinishReasonEnum.php @@ -9,7 +9,7 @@ /** * Enum for finish reasons of AI generation. * - * @since n.e.x.t + * @since 0.1.0 * * @method static self stop() Creates an instance for STOP reason. * @method static self length() Creates an instance for LENGTH reason. diff --git a/src/Tools/DTO/FunctionCall.php b/src/Tools/DTO/FunctionCall.php index a98761f8..ffb009ae 100644 --- a/src/Tools/DTO/FunctionCall.php +++ b/src/Tools/DTO/FunctionCall.php @@ -13,7 +13,7 @@ * This DTO encapsulates information about a function that the AI model * wants to invoke, including the function name and its arguments. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-type FunctionCallArrayShape array{id?: string, name?: string, args?: mixed} * @@ -42,7 +42,7 @@ class FunctionCall extends AbstractDataTransferObject /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param string|null $id Unique identifier for this function call. * @param string|null $name The name of the function to call. @@ -63,7 +63,7 @@ public function __construct(?string $id = null, ?string $name = null, $args = nu /** * Gets the function call ID. * - * @since n.e.x.t + * @since 0.1.0 * * @return string|null The function call ID. */ @@ -75,7 +75,7 @@ public function getId(): ?string /** * Gets the function name. * - * @since n.e.x.t + * @since 0.1.0 * * @return string|null The function name. */ @@ -87,7 +87,7 @@ public function getName(): ?string /** * Gets the function arguments. * - * @since n.e.x.t + * @since 0.1.0 * * @return mixed The function arguments. */ @@ -99,7 +99,7 @@ public function getArgs() /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -133,7 +133,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return FunctionCallArrayShape */ @@ -159,7 +159,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Tools/DTO/FunctionDeclaration.php b/src/Tools/DTO/FunctionDeclaration.php index 66c024b1..5b08ce80 100644 --- a/src/Tools/DTO/FunctionDeclaration.php +++ b/src/Tools/DTO/FunctionDeclaration.php @@ -12,7 +12,7 @@ * This DTO describes a function that can be called by the AI model, * including its name, description, and parameter schema. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-type FunctionDeclarationArrayShape array{ * name: string, @@ -45,7 +45,7 @@ class FunctionDeclaration extends AbstractDataTransferObject /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $name The name of the function. * @param string $description A description of what the function does. @@ -61,7 +61,7 @@ public function __construct(string $name, string $description, ?array $parameter /** * Gets the function name. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The function name. */ @@ -73,7 +73,7 @@ public function getName(): string /** * Gets the function description. * - * @since n.e.x.t + * @since 0.1.0 * * @return string The function description. */ @@ -85,7 +85,7 @@ public function getDescription(): string /** * Gets the function parameters schema. * - * @since n.e.x.t + * @since 0.1.0 * * @return array|null The parameters schema. */ @@ -97,7 +97,7 @@ public function getParameters(): ?array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -125,7 +125,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return FunctionDeclarationArrayShape */ @@ -146,7 +146,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Tools/DTO/FunctionResponse.php b/src/Tools/DTO/FunctionResponse.php index 4d6d4143..6ace1b72 100644 --- a/src/Tools/DTO/FunctionResponse.php +++ b/src/Tools/DTO/FunctionResponse.php @@ -13,7 +13,7 @@ * This DTO encapsulates the result of executing a function that was * requested by the AI model through a FunctionCall. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-type FunctionResponseArrayShape array{id: string, name: string, response: mixed} * @@ -42,7 +42,7 @@ class FunctionResponse extends AbstractDataTransferObject /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $id The ID of the function call this is responding to. * @param string $name The name of the function that was called. @@ -58,7 +58,7 @@ public function __construct(string $id, string $name, $response) /** * Gets the function call ID. * - * @since n.e.x.t + * @since 0.1.0 * * @return string|null The function call ID. */ @@ -70,7 +70,7 @@ public function getId(): ?string /** * Gets the function name. * - * @since n.e.x.t + * @since 0.1.0 * * @return string|null The function name. */ @@ -82,7 +82,7 @@ public function getName(): ?string /** * Gets the function response. * - * @since n.e.x.t + * @since 0.1.0 * * @return mixed The response data. */ @@ -94,7 +94,7 @@ public function getResponse() /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -128,7 +128,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return FunctionResponseArrayShape */ @@ -144,7 +144,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/Tools/DTO/WebSearch.php b/src/Tools/DTO/WebSearch.php index 474c3318..212cf48d 100644 --- a/src/Tools/DTO/WebSearch.php +++ b/src/Tools/DTO/WebSearch.php @@ -12,7 +12,7 @@ * This DTO defines constraints for web searches that AI models can perform, * including allowed and disallowed domains. * - * @since n.e.x.t + * @since 0.1.0 * * @phpstan-type WebSearchArrayShape array{allowedDomains?: string[], disallowedDomains?: string[]} * @@ -35,7 +35,7 @@ class WebSearch extends AbstractDataTransferObject /** * Constructor. * - * @since n.e.x.t + * @since 0.1.0 * * @param string[] $allowedDomains List of domains that are allowed for web search. * @param string[] $disallowedDomains List of domains that are disallowed for web search. @@ -49,7 +49,7 @@ public function __construct(array $allowedDomains = [], array $disallowedDomains /** * Gets the allowed domains. * - * @since n.e.x.t + * @since 0.1.0 * * @return string[] The allowed domains. */ @@ -61,7 +61,7 @@ public function getAllowedDomains(): array /** * Gets the disallowed domains. * - * @since n.e.x.t + * @since 0.1.0 * * @return string[] The disallowed domains. */ @@ -73,7 +73,7 @@ public function getDisallowedDomains(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function getJsonSchema(): array { @@ -102,7 +102,7 @@ public static function getJsonSchema(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 * * @return WebSearchArrayShape */ @@ -117,7 +117,7 @@ public function toArray(): array /** * {@inheritDoc} * - * @since n.e.x.t + * @since 0.1.0 */ public static function fromArray(array $array): self { diff --git a/src/polyfills.php b/src/polyfills.php index dc5d5557..d5bbee6d 100644 --- a/src/polyfills.php +++ b/src/polyfills.php @@ -3,7 +3,7 @@ /** * Polyfills for PHP functions that may not be available in older versions. * - * @since n.e.x.t + * @since 0.1.0 */ declare(strict_types=1); @@ -14,7 +14,7 @@ * * An array is considered a list if its keys consist of consecutive numbers from 0 to count($array)-1. * - * @since n.e.x.t + * @since 0.1.0 * * @param array $array The array to check. * @return bool True if the array is a list, false otherwise. @@ -41,7 +41,7 @@ function array_is_list(array $array): bool /** * Checks if a string starts with a given substring. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $haystack The string to search in. * @param string $needle The substring to search for. @@ -61,7 +61,7 @@ function str_starts_with(string $haystack, string $needle): bool /** * Checks if a string contains a given substring. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $haystack The string to search in. * @param string $needle The substring to search for. @@ -81,7 +81,7 @@ function str_contains(string $haystack, string $needle): bool /** * Checks if a string ends with a given substring. * - * @since n.e.x.t + * @since 0.1.0 * * @param string $haystack The string to search in. * @param string $needle The substring to search for. diff --git a/tests/mocks/MockHttpTransporter.php b/tests/mocks/MockHttpTransporter.php index 711a912b..739f90e4 100644 --- a/tests/mocks/MockHttpTransporter.php +++ b/tests/mocks/MockHttpTransporter.php @@ -25,8 +25,6 @@ class MockHttpTransporter implements HttpTransporterInterface /** * {@inheritDoc} - * - * @since n.e.x.t */ public function send(Request $request): Response { diff --git a/tests/mocks/MockModel.php b/tests/mocks/MockModel.php index 7623b122..13d4a9a2 100644 --- a/tests/mocks/MockModel.php +++ b/tests/mocks/MockModel.php @@ -15,8 +15,6 @@ /** * Mock model for testing. - * - * @since n.e.x.t */ class MockModel implements ModelInterface, WithHttpTransporterInterface, WithRequestAuthenticationInterface { diff --git a/tests/mocks/MockModelMetadataDirectory.php b/tests/mocks/MockModelMetadataDirectory.php index f2b21603..9ade638d 100644 --- a/tests/mocks/MockModelMetadataDirectory.php +++ b/tests/mocks/MockModelMetadataDirectory.php @@ -14,8 +14,6 @@ /** * Mock model metadata directory for testing. - * - * @since n.e.x.t */ class MockModelMetadataDirectory implements ModelMetadataDirectoryInterface, diff --git a/tests/mocks/MockProvider.php b/tests/mocks/MockProvider.php index 7ad38a3c..8414046d 100644 --- a/tests/mocks/MockProvider.php +++ b/tests/mocks/MockProvider.php @@ -16,8 +16,6 @@ /** * Mock provider for testing purposes. - * - * @since n.e.x.t */ class MockProvider implements ProviderInterface { diff --git a/tests/mocks/MockProviderAvailability.php b/tests/mocks/MockProviderAvailability.php index 0e4a8f0b..443d22b7 100644 --- a/tests/mocks/MockProviderAvailability.php +++ b/tests/mocks/MockProviderAvailability.php @@ -12,8 +12,6 @@ /** * Mock provider availability for testing. - * - * @since n.e.x.t */ class MockProviderAvailability implements ProviderAvailabilityInterface, diff --git a/tests/mocks/MockRequestAuthentication.php b/tests/mocks/MockRequestAuthentication.php index 8c1eafb1..68a1f470 100644 --- a/tests/mocks/MockRequestAuthentication.php +++ b/tests/mocks/MockRequestAuthentication.php @@ -30,8 +30,6 @@ public function __construct(string $token = 'mock_token') /** * {@inheritDoc} - * - * @since n.e.x.t */ public function authenticateRequest(Request $request): Request { @@ -40,8 +38,6 @@ public function authenticateRequest(Request $request): Request /** * {@inheritDoc} - * - * @since n.e.x.t */ public static function getJsonSchema(): array { diff --git a/tests/traits/MockModelCreationTrait.php b/tests/traits/MockModelCreationTrait.php index 3423f950..ecf033c8 100644 --- a/tests/traits/MockModelCreationTrait.php +++ b/tests/traits/MockModelCreationTrait.php @@ -27,16 +27,12 @@ * * This trait consolidates common mock model creation logic to reduce * code duplication across test classes and improve maintainability. - * - * @since n.e.x.t */ trait MockModelCreationTrait { /** * Creates a provider registry with the mock provider registered. * - * @since n.e.x.t - * * @return ProviderRegistry The registry with mock provider. */ protected function createRegistryWithMockProvider(): ProviderRegistry diff --git a/tests/unit/Messages/DTO/MessageTest.php b/tests/unit/Messages/DTO/MessageTest.php index 757967f3..4f2c7024 100644 --- a/tests/unit/Messages/DTO/MessageTest.php +++ b/tests/unit/Messages/DTO/MessageTest.php @@ -383,8 +383,6 @@ public function testImplementsWithArrayTransformationInterface(): void /** * Tests that withPart creates a new instance with the part appended. - * - * @since n.e.x.t */ public function testWithPartCreatesNewInstance(): void { diff --git a/tests/unit/Messages/DTO/UserMessageTest.php b/tests/unit/Messages/DTO/UserMessageTest.php index a7be9dda..e08069ec 100644 --- a/tests/unit/Messages/DTO/UserMessageTest.php +++ b/tests/unit/Messages/DTO/UserMessageTest.php @@ -314,8 +314,6 @@ public function testImplementsWithArrayTransformationInterface(): void /** * Tests that withPart returns a new Message with user role. - * - * @since n.e.x.t */ public function testWithPartReturnsNewMessage(): void {