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 three popular LLM services: Groq, OpenAI, and Fireworks.

Groq

GroqLLM is a fast and efficient language model service.

Updating the Prompt and Model

To update the prompt and model for GroqLLM in your voice bot, modify the system_prompt and model parameters when initializing the GroqLLM node:

import outspeed as sp

@sp.App()
class VoiceBot:
    async def setup(self) -> None:
        """
        Initialize the VoiceBot.
        """
        # ... existing code ...
        self.llm_node = sp.GroqLLM(
            system_prompt="You are a friendly AI assistant. Provide concise and helpful responses.",
            model="llama-3.1-8b-instant",  # Choose from available models
        )
        # ... existing code ...

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

OpenAI

OpenAI offers powerful language models through their API.

Updating the Prompt and Model

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

o1 models are not supported yet.
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 ...

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

Fireworks

FireworksLLM is another LLM service that can be used in your voice bot.

Updating the Prompt and Model

To update the prompt and model for FireworksLLM, adjust the system_prompt and model parameters:

import outspeed as sp

@sp.App()
class VoiceBot:
    async def setup(self) -> None:
        """
        Initialize the VoiceBot.
        """
        # ... existing code ...
        self.llm_node = sp.FireworksLLM(
            system_prompt="You are a creative AI assistant. Generate imaginative and engaging responses.",
            model="accounts/fireworks/models/llama-v3p1-70b-instruct",  # Choose from available models
        )
        # ... existing code ...

For a complete and up-to-date list of available Fireworks models, please refer to the Fireworks 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.