venice-dev-tools

Character Interaction

Venice AI provides a unique feature that allows you to interact with predefined AI characters. These characters have specific personalities, knowledge bases, and interaction styles that can enhance your conversational experiences.

What are Venice AI Characters?

Characters in Venice AI are predefined personalities with specific traits, knowledge domains, and conversational styles. They allow you to interact with AI in more specialized and engaging ways, tailored to particular use cases or scenarios.

Available Characters

Venice AI offers a variety of characters for different purposes:

Using Characters in the SDK

Listing Available Characters

To see all available characters:

import { VeniceNode } from '@venice-dev-tools/node';

const venice = new VeniceNode({
  apiKey: 'your-api-key',
});

async function listCharacters() {
  const characters = await venice.characters.list();
  console.log(characters);
}

listCharacters();

Chatting with a Character

To interact with a specific character:

import { VeniceNode } from '@venice-dev-tools/node';

const venice = new VeniceNode({
  apiKey: 'your-api-key',
});

async function chatWithCharacter() {
  const response = await venice.chat.createCompletion({
    model: 'llama-3.3-70b',
    character: 'Scientist',
    messages: [
      { role: 'user', content: 'Explain quantum entanglement in simple terms' }
    ]
  });
  
  console.log(response.choices[0].message.content);
}

chatWithCharacter();

Using Characters in the CLI

The Venice Dev Tools CLI provides a simple way to interact with characters:

# List all available characters
venice characters list

# Chat with a specific character
venice chat --character "Scientist" "Explain quantum entanglement in simple terms"

Character Interaction Best Practices

To get the most out of character interactions:

  1. Choose the Right Character: Select a character whose expertise aligns with your query
  2. Be Specific: Provide clear and specific prompts that leverage the character’s specialty
  3. Maintain Context: Characters maintain conversation context, so you can have ongoing discussions
  4. Experiment: Try different characters for the same question to see varied perspectives

Example Use Cases

Educational Scenarios

Use the Teacher or Scientist character to explain complex concepts:

const response = await venice.chat.createCompletion({
  model: 'llama-3.3-70b',
  character: 'Teacher',
  messages: [
    { role: 'user', content: 'Explain photosynthesis to a 10-year-old' }
  ]
});

Creative Writing

Use the Creative Writer character for storytelling and content creation:

const response = await venice.chat.createCompletion({
  model: 'llama-3.3-70b',
  character: 'Creative Writer',
  messages: [
    { role: 'user', content: 'Write a short story about a robot discovering emotions' }
  ]
});

Technical Support

Use the Programmer character for coding help:

const response = await venice.chat.createCompletion({
  model: 'llama-3.3-70b',
  character: 'Programmer',
  messages: [
    { role: 'user', content: 'How do I implement a binary search tree in JavaScript?' }
  ]
});

Advanced Character Interactions

Combining Characters with Streaming

You can use characters with streaming for real-time responses:

const stream = await venice.chat.createCompletionStream({
  model: 'llama-3.3-70b',
  character: 'Philosopher',
  messages: [
    { role: 'user', content: 'What is the nature of consciousness?' }
  ]
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content || '');
}

Combine characters with web search for up-to-date information:

const response = await venice.chat.createCompletion({
  model: 'llama-3.3-70b',
  character: 'Business Analyst',
  web_search: true,
  messages: [
    { role: 'user', content: 'What are the latest trends in renewable energy investments?' }
  ]
});

Character Limitations

While characters enhance the interaction experience, be aware of these limitations:

Creating Custom Characters

Currently, Venice AI provides a fixed set of characters. Custom character creation is planned for future releases of the platform.

Privacy Considerations

Like all interactions with Venice AI, character conversations maintain the same privacy guarantees: