Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
432 changes: 431 additions & 1 deletion src/CrowdinApiClient/Api/AiApi.php

Large diffs are not rendered by default.

393 changes: 392 additions & 1 deletion src/CrowdinApiClient/Api/Enterprise/AiApi.php

Large diffs are not rendered by default.

197 changes: 197 additions & 0 deletions src/CrowdinApiClient/Model/AiPrompt.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
<?php

declare(strict_types=1);

namespace CrowdinApiClient\Model;

class AiPrompt extends BaseModel
{
/** @var int */
protected $id;

/** @var string */
protected $name;

/** @var string */
protected $action;

/** @var int|null */
protected $aiProviderId;

/** @var string|null */
protected $aiModelId;

/** @var bool */
protected $isEnabled;

/** @var int[] */
protected $enabledProjectIds;

/** @var array */
protected $config;

/** @var string|null */
protected $promptPreview;

/** @var bool */
protected $isFineTuningAvailable;

/** @var int|null */
protected $createdBy;

/** @var int|null */
protected $updatedBy;

/** @var int|null */
protected $lastUsedBy;

/** @var string|null */
protected $lastUsedAt;

/** @var int */
protected $usageCount;

/** @var string */
protected $createdAt;

/** @var string */
protected $updatedAt;

public function __construct(array $data = [])
{
parent::__construct($data);

$this->id = (int)$this->getDataProperty('id');
$this->name = (string)$this->getDataProperty('name');
$this->action = (string)$this->getDataProperty('action');
$this->aiProviderId = $this->getDataProperty('aiProviderId');
$this->aiModelId = $this->getDataProperty('aiModelId');
$this->isEnabled = (bool)$this->getDataProperty('isEnabled');
$this->enabledProjectIds = (array)$this->getDataProperty('enabledProjectIds');
$this->config = (array)$this->getDataProperty('config');
$this->promptPreview = $this->getDataProperty('promptPreview');
$this->isFineTuningAvailable = (bool)$this->getDataProperty('isFineTuningAvailable');
$this->createdBy = $this->getDataProperty('createdBy');
$this->updatedBy = $this->getDataProperty('updatedBy');
$this->lastUsedBy = $this->getDataProperty('lastUsedBy');
$this->lastUsedAt = $this->getDataProperty('lastUsedAt');
$this->usageCount = (int)$this->getDataProperty('usageCount');
$this->createdAt = (string)$this->getDataProperty('createdAt');
$this->updatedAt = (string)$this->getDataProperty('updatedAt');
}

public function getId(): int
{
return $this->id;
}

public function getName(): string
{
return $this->name;
}

public function getAction(): string
{
return $this->action;
}

public function getAiProviderId(): ?int
{
return $this->aiProviderId;
}

public function getAiModelId(): ?string
{
return $this->aiModelId;
}

public function isEnabled(): bool
{
return $this->isEnabled;
}

public function getEnabledProjectIds(): array
{
return $this->enabledProjectIds;
}

public function getConfig(): array
{
return $this->config;
}

public function getPromptPreview(): ?string
{
return $this->promptPreview;
}

public function isFineTuningAvailable(): bool
{
return $this->isFineTuningAvailable;
}

public function getCreatedBy(): ?int
{
return $this->createdBy;
}

public function getUpdatedBy(): ?int
{
return $this->updatedBy;
}

public function getLastUsedBy(): ?int
{
return $this->lastUsedBy;
}

public function getLastUsedAt(): ?string
{
return $this->lastUsedAt;
}

public function getUsageCount(): int
{
return $this->usageCount;
}

public function getCreatedAt(): string
{
return $this->createdAt;
}

public function getUpdatedAt(): string
{
return $this->updatedAt;
}

public function setName(string $name): void
{
$this->name = $name;
}

public function setAction(string $action): void
{
$this->action = $action;
}

public function setAiProviderId(?int $aiProviderId): void
{
$this->aiProviderId = $aiProviderId;
}

public function setAiModelId(?string $aiModelId): void
{
$this->aiModelId = $aiModelId;
}

public function setEnabledProjectIds(array $enabledProjectIds): void
{
$this->enabledProjectIds = $enabledProjectIds;
}

public function setConfig(array $config): void
{
$this->config = $config;
}
}
86 changes: 86 additions & 0 deletions src/CrowdinApiClient/Model/AiPromptCompletion.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

declare(strict_types=1);

namespace CrowdinApiClient\Model;

class AiPromptCompletion extends BaseModel
{
/** @var string */
protected $identifier;

/** @var string */
protected $status;

/** @var int */
protected $progress;

/** @var array */
protected $attributes;

/** @var string */
protected $createdAt;

/** @var string|null */
protected $updatedAt;

/** @var string|null */
protected $startedAt;

/** @var string|null */
protected $finishedAt;

public function __construct(array $data = [])
{
parent::__construct($data);

$this->identifier = (string)$this->getDataProperty('identifier');
$this->status = (string)$this->getDataProperty('status');
$this->progress = (int)$this->getDataProperty('progress');
$this->attributes = (array)$this->getDataProperty('attributes');
$this->createdAt = (string)$this->getDataProperty('createdAt');
$this->updatedAt = $this->getDataProperty('updatedAt');
$this->startedAt = $this->getDataProperty('startedAt');
$this->finishedAt = $this->getDataProperty('finishedAt');
}

public function getIdentifier(): string
{
return $this->identifier;
}

public function getStatus(): string
{
return $this->status;
}

public function getProgress(): int
{
return $this->progress;
}

public function getAttributes(): array
{
return $this->attributes;
}

public function getCreatedAt(): string
{
return $this->createdAt;
}

public function getUpdatedAt(): ?string
{
return $this->updatedAt;
}

public function getStartedAt(): ?string
{
return $this->startedAt;
}

public function getFinishedAt(): ?string
{
return $this->finishedAt;
}
}
Loading
Loading