Prebuilt task-specific AI agents running exclusively on Groq hardware. This project is currently under development.
To install the necessary dependencies, run:
npm install
To build the project, execute:
npm run build
Then, you can utilize the GroqAgent
class as follows:
import GroqAgent from './dist/index';
async function demo() {
const client = new GroqAgent('your_api_key', 'llama3-70b-8192');
console.log(await client.models()); // Logs all available models
console.log(await client.agents()); // Logs all available agents
const agent = client.create('Write a poem', 'You are a poet');
console.log(agent.messages[agent.messages.length - 1].content); // Logs the last message content
}
demo();
Replace 'your_api_key'
with your actual Groq API key. You can obtain an API key by signing up at Groq Console.
The GroqAgent
class provides methods to interact with Groq's AI models and agents.
Retrieves a list of available agents.
Returns:
Promise<Array>
: An array of agent names.
Example:
const availableAgents = await client.agents();
console.log(availableAgents);
Selects a specific agent by name.
Parameters:
agentName
(string): The name of the agent to select.
Returns:
Object
: The selected agent object.
Example:
const agent = client.selectAgent('agent_name');
console.log(agent);
Sends input to the selected agent and retrieves the response.
Parameters:
input
(string): The input text to send to the agent.
Returns:
Promise<string>
: The agent's response.
Example:
const response = await agent.call('Your input text');
console.log(response);
Fetches a list of available models.
Returns:
Promise<Array>
: An array of model names.
Example:
const availableModels = await client.models();
console.log(availableModels);
Creates a new agent with a specific prompt and system message.
Parameters:
prompt
(string): The initial prompt for the agent.systemMessage
(string): The system message defining the agent's behavior.
Returns:
Object
: The created agent object.
Example:
const agent = client.create('Write a poem', 'You are a poet');
console.log(agent);
We welcome contributions to enhance this project. To contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature/YourFeature
. - Commit your changes:
git commit -m 'Add YourFeature'
. - Push to the branch:
git push origin feature/YourFeature
. - Open a pull request.
Please ensure your code adheres to the project's coding standards and includes appropriate tests.
This project is licensed under the MIT License. See the LICENSE file for details.