Avatar Action

Allows an avatar image to be added to the agent.

Avatar Action

GitHub release (latest by date) GitHub Workflow Status GitHub issues GitHub pull requests GitHub

This action is designed to permit the upload and serving of an avatar image for your agent.

Package Information

  • Name: jivas/avatar_action
  • Author: V75 Inc.
  • Architype: AvatarAction

Meta Information

  • Title: Avatar Action
  • Group: core
  • Type: action

Configuration

  • Singleton: true

Dependencies

  • Jivas: ^2.0.0

Avatar Action API

The Avatar Action supports avatar management for agents via a unified API endpoint. You can set, retrieve, and delete an agent's avatar image using the set_avatar, get_avatar, and delete_avatar walkers respectively.

Endpoint

POST /action/walker


Required Parameters

Parameter Description Example Value
agent_id The ID of the agent "my-agent-uuid"
module_root Module root for these actions "actions.jivas.avatar_action"
walker The operation to perform "set_avatar"
args Arguments dictionary for the walker See examples below
files List of file objects, required for upload operations See below

Walkers and Payload Examples

1. Set Avatar

Walker: 'set_avatar'

  • Uploads and sets an avatar image for the agent.
  • The files parameter should include the image file to be set as the avatar.
  • The image content needs to be base64-encoded on the backend.

Sample Payload

{
    "agent_id": "my-agent-uuid",
    "module_root": "actions.jivas.avatar_action",
    "walker": "set_avatar",
    "args": {},
    "files": [
        {
            "name": "avatar.png",
            "content": "<binary image data>",
            "type": "image/png"
        }
    ]
}

2. Get Avatar

Walker: 'get_avatar'

  • Retrieves the avatar image for the agent as a base64 encoded string.
  • You may specify whether to include a base64 prefix using base64_prefix.

Sample Payload

{
    "agent_id": "my-agent-uuid",
    "module_root": "actions.jivas.avatar_action",
    "walker": "get_avatar",
    "args": {
        "base64_prefix": true
    },
    "files": []
}

3. Delete Avatar

Walker: 'delete_avatar'

  • Deletes the agent's avatar image.

Sample Payload

{
    "agent_id": "my-agent-uuid",
    "module_root": "actions.jivas.avatar_action",
    "walker": "delete_avatar",
    "args": {},
    "files": []
}

Notes

  • The response structure will depend on the walker's implementation.
  • For set_avatar, ensure the image file is properly encoded and the mimetype is correctly specified.
  • For get_avatar, if base64_prefix is True, the returned string will include the mimetype prefix (e.g., data:image/png;base64,).
  • Errors and status messages will be returned as part of the response.

Best Practices

  • Validate your API keys and model parameters before deployment.
  • Test pipelines in a staging environment before production use.

🔰 Contributing

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your GitHub account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/TrueSelph/avatar_action
    
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
    
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
    
  6. Push to GitHub: Push the changes to your forked repository.
    git push origin new-feature-x
    
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
Contributor Graph

🎗 License

This project is protected under the Apache License 2.0. See LICENSE for more information.

Install
jvcli download action jivas/avatar_action

Last published

2 months ago

Version

0.0.1

Downloads

220

Author

jivas

Type

action

Visibility

Public

Tags

core
action