Repository navigation
Closed
Copy link
Labels
Description
Summary
Add a CreateAvatar agent tool, a thin wrapper over avatars.Create, the same code behind infer avatars create (#1270). The agent could then build an avatar mid-conversation. The command can't cover three flows:
- Generated portraits. "Make a presenter avatar, then have them say this line" in one run. Portraits from
ImageGeneration/ImageEditland in the project's artifacts dir.TextToVideodoes not look there, and the agent cannot move files into~/.infer/avatars. - Channels. A user sends a selfie over Telegram ("make this my avatar"); there is no terminal to run the command.
- Desktop Content projects. The project agent creates the avatar as a step of the video workflow, not only from the Settings page ([FEATURE] Avatars: record once, reuse a talking avatar in Content projects desktop#311).
Blocked by #1270 (avatar library, avatars.Create, infer avatars create).
Design
CreateAvatar { name: "presenter", photo: "portrait.png",
angles?: ["three-quarter-left", "three-quarter-right"],
quality?: "high", size?: "1024x1536" }
-> { name, images: ["01-front.png", "02-three-quarter-left.png", "03-three-quarter-right.png"] }
- Opt-in, stricter than TextToVideo. The tool can turn any face it sees into an avatar and sends the photo to the image-edit provider (OpenAI by default). So:
- It has its own switch,
text_to_video.create_avatar(defaultfalse). The tool is registered only when that andtext_to_video.enabledare both true. IsApprovalRequired("CreateAvatar")defaults totrueunlessrequire_approvalis set explicitly.
- It has its own switch,
- Photo confinement.
photois a bare file name, resolved in the working directory (sandbox-checked viaValidatePathInSandbox) and then in the current project's artifacts dir, where generated images land. There are no absolute paths, no..and no arbitrary locations: unlike the ImageEdit tool, it never reads a file outside those two places. Only.png,.jpg,.jpegand.webp. - Create only. It never overwrites (
avatars.Createalready refuses an existing name), and there is no delete tool; deleting stays a user action (infer avatars delete). Listing needs no tool:TextToVideoalready answers an unknown avatar with the available names. - Same knobs as the command.
anglesdefaults to both three-quarter views, and[]only copies the photo.qualitydefaults tohighandsizeto1024x1536. The model istools.image_edit.model, and the tool fails clearly when image edit is disabled. - Wiring.
- The tool lives in
internal/agent/tools/create_avatar.go, takesagentdomain.ImageService(already wired for ImageEdit) and passes anavatars.EditFuncoverEditImage. - It is registered in
registry.goand gets a prompt inconfig/prompts.go. - The gateway manager already sets
IMAGES_ENABLEDwhiletools.image_edit.enabledis on.
- The tool lives in
- Result formatting. The result lists the saved images so the agent can go straight to
TextToVideo { avatar: "presenter", audio: ... }.
Out of scope
Deleting or overwriting avatars from the agent, editing an existing avatar's images, and sending the extra views as reference images (inference-gateway/schemas#221).
Acceptance Criteria
-
CreateAvataris registered only whentext_to_video.enabledandtext_to_video.create_avatarare both true, and requires approval by default. -
photoresolves only in the working directory (sandbox-checked) or the project artifacts dir; absolute paths,.., directories and unsupported extensions are rejected inValidate. - An existing avatar name fails without calling the image-edit service, and a failed angle leaves no avatar folder (covered by
avatars.Create). -
angles,qualityandsizeare validated against the same sets asinfer avatars create, with the same defaults. - Unit tests use the counterfeiter
FakeImageService; registry gating and approval-default tests are included. -
docs/tools-reference.mdanddocs/text-to-video.mddocument the tool, the opt-in and the privacy note, and a[DOCS]ticket is filed for inference-gateway/docs.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
feat(tools): add CreateAvatar tool (#1271)
feat(tools): add TextToVideo tool for gateway video generation with l…
inference-gateway-releaser commentedon Sep 23, 2026
🎉 This issue has been resolved in version 0.206.0 🎉
The release is available on:
Your semantic-release bot 📦🚀