Skip to content

Allow assistant to specify its logo #556

Closed
@pmeier

Description

@pmeier

Ragna has a few logos builtin

if organization == "Ragna":
return "imgs/ragna_logo.svg"
elif organization == "OpenAI":
if model.startswith("gpt-3"):
return "https://upload.wikimedia.org/wikipedia/commons/thumb/0/04/ChatGPT_logo.svg/1024px-ChatGPT_logo.svg.png?20230318122128"
elif model.startswith("gpt-4"):
return "https://upload.wikimedia.org/wikipedia/commons/a/a4/GPT-4.png"
elif organization == "Anthropic":
return "https://upload.wikimedia.org/wikipedia/commons/1/14/Anthropic.png"
return model[0].upper()

This is neither scalable nor compatible with the fact that users can specify their own assistants. We should have an Assistant.avatar() -> str (name TBD) method or property that defaults to the same behavior that we have right now. This method or property should be honored by the UI.

Tasks:

  1. Define Assistant.avatar() -> str as method or property on the base class.

  2. Implement 1. on all builtin assistants

  3. Figure out a way to make the avatar available through the engine. IMO, it would be best if we could somehow fit it into

    def get_components(self) -> schemas.Components:

    but maybe a standalone function is simpler for now.

  4. Use the returned avatar from the engine in the UI

  5. If we chose to use a standalone function in 3., add a new endpoint to the API.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions