In this guide, we’ll explore how to update prompts and models for different Language Model (LLM) services in your voice bot. We’ll cover two popular LLM services: OpenAI and Fireworks.

OpenAI

OpenAI offers powerful language models through their API.

Trying Out Models Online

  1. Visit the OpenAI Models page.
  2. Browse through the available models or use the search function to find specific types of models.
  3. Click on a model to see its capabilities.
  4. Note the model ID, which you’ll need for the next step.

Updating the Prompt and Model in voice_bot.py

To update the prompt and model for OpenAILLM, modify the system_prompt and model parameters as shown below:

import outspeed as sp

@sp.App()
class VoiceBot:
    async def setup(self) -> None:
        """
        Initialize the VoiceBot.
        """
        # ... existing code ...
        self.llm_node = sp.OpenAILLM(
            system_prompt="You are an AI assistant specializing in technical support. Provide clear and accurate information.",
            model="gpt-4-turbo-preview",  # Choose from available models
        )
        # ... existing code ...
o1 models are not supported yet.

For a complete and up-to-date list of available OpenAI models, please refer to the OpenAI Models page.

Best Practices for Updating Prompts and Models

  1. Be Specific: Clearly define the role and behavior you want the AI to adopt in your prompt.
  2. Keep it Concise: Avoid overly long prompts that might confuse the model.
  3. Test Thoroughly: After updating the prompt or model, test your bot to ensure it behaves as expected.
  4. Iterate: Refine your prompt based on the responses you get from the bot.
  5. Consider Model Capabilities: Different models have different strengths and limitations. Choose a model that best fits your use case.
  6. Stay Updated: LLM providers frequently release new models. Keep an eye on their documentation for the latest available models and their capabilities.

Remember, the effectiveness of your prompt and the choice of model can significantly impact the quality and relevance of your voice bot’s responses. Experiment with different combinations to find the one that best suits your use case.

Always refer to the official documentation of each LLM provider for the most up-to-date list of available models and their specific capabilities.