SimpleMind is an AI library designed to simplify your experience with AI APIs in Python. Inspired by a "for humans" philosophy, it abstracts away complexity, giving developers an intuitive and human-friendly way to interact with powerful AI capabilities. With SimpleMind, tapping into AI is as easy as a friendly conversation.
```bash
$ pip install simplemind
```
## Features
- **Easy-to-use AI tools**: SimpleMind provides simple interfaces to popular AI services.
- **Human-centered design**: The library prioritizes readability and usability—no need to be an expert to start experimenting.
@@ -11,44 +15,38 @@ SimpleMind is an AI library designed to simplify your experience with AI APIs in
## Supported APIs
- **OpenAI's GPT**
- **Anthropic's Claude**
- **xAI's Grok**
- **Groq's Groq**
- **Ollama's Ollama**
To specify a specific provider or model, you can use the `llm_provider` and `llm_model` parameters when calling: `generate_text`, `generate_data`, or `create_conversation`.
If you'd like to see SimpleMind support additional providers or models, please send a pull request!
## Why SimpleMind?
- **Intuitive**: Built with Pythonic simplicity and readability in mind.
- **For Humans**: Emphasizes a human-friendly interface, just like `requests` for HTTP.
- **Open Source**: SimpleMind is open source, and contributions are always welcome!
## Installation
Coming soon!
```bash
$ pip install simplemind
```
## Quickstart
SimpleMind takes care of the complex API calls so you can focus on what matters—building, experimenting, and creating.
```python
importsimplemindassm
```
Authenticate your API keys by setting them in the environment variables:
First, authenticate your API keys by setting them in the environment variables:
```bash
$ exportOPENAI_API_KEY="sk-..."
```
Other supported environment variables: `ANTHROPIC_API_KEY`, `GROK_API_KEY`, `XAI_API_KEY`, and `GROQ_API_KEY`.
This pattern allows you to keep your API keys private and out of your codebase. Other supported environment variables: `ANTHROPIC_API_KEY`, `GROK_API_KEY`, `XAI_API_KEY`, and `GROQ_API_KEY`.
Next, import SimpleMind and start using it:
```python
importsimplemindassm
```
## Examples
@@ -64,7 +62,7 @@ Generate a response from an AI model based on a given prompt:
"The meaning of life is a profound philosophical question that has been explored by cultures, religions, and philosophers for centuries. Different people and belief systems offer varying interpretations:\n\n1. **Religious Perspectives:** Many religions propose that the meaning of life is to fulfill a divine purpose, serve God, or reach an afterlife. For example, Christianity often emphasizes love, faith, and service to God and others as central to life’s meaning.\n\n2. **Philosophical Views:** Philosophers offer diverse answers. Existentialists like Jean-Paul Sartre argue that life has no inherent meaning, and it is up to individuals to create their own purpose. Others, like Aristotle, suggest that achieving eudaimonia (flourishing or happiness) through virtuous living is the key to a meaningful life.\n\n3. **Scientific and Secular Approaches:** Some people find meaning through understanding the natural world, contributing to human knowledge, or through personal accomplishments and happiness. They may view life's meaning as a product of connection, legacy, or the pursuit of knowledge and creativity.\n\n4. **Personal Perspective:** For many, the meaning of life is deeply personal, involving their relationships, passions, and goals. These individuals define life's purpose through experiences, connections, and the impact they have on others and the world.\n\nUltimately, the meaning of life is a subjective question, with each person finding their own answers based on their beliefs, experiences, and reflections."
```
### Structured Response
### Structured Data with Pydantic
You can use Pydantic models to structure the response from the LLM, if the LLM supports it.
@@ -183,11 +181,6 @@ To get started:
3. Make your changes.
4. Submit a pull request.
## Building
1. Clone the repository.
2.`cd` to the root directory.
3. Run `docker-compose up --build`
## License
SimpleMind is licensed under the Apache 2.0 License.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.