alioth-center / akasha-whisper

AKasha Whisper是一个基于AI工作流的对话机器人核心,提供基于文本、音频等多种方式的连续对话
MIT License
2 stars 1 forks source link

Feature develop: implement akasha-whisper as an openai compatible service endpoint provider #2

Open sunist-c opened 4 weeks ago

sunist-c commented 4 weeks ago

Implement the first release version of akasha-whisper as an OpenAI compatible service endpoint provider

Reference: [akasha-whisper]

Summary

Implement the initial version of the Akasha-Whisper backend component, which will be compatible with OpenAI APIs. This component will interact with the Akasha-Agent and will include API key validation, user permission checks, and an automatic multi-service endpoint rotation mechanism to optimize cost and availability.

Function expected

Logic of service endpoint rotation mechanism

  1. Implement the logic to choose the most cost-effective service provider under normal conditions.
  2. Develop a weighted round-robin mechanism based on the balance-to-price ratio of each service provider.
  3. Implement retry logic to switch to the next provider if the current one is unavailable, up to a configured number of retries.
  4. Return an error message if all retries are exhausted.
  5. Implement a notification system to alert developers when a provider's balance falls below a set threshold.