11 Commits

4 changed files with 30 additions and 27 deletions
+10
View File
@@ -0,0 +1,10 @@
Release History
===============
## 0.1.1 (2024-10-29)
- Fix Groq provider.
## 0.1.0 (2024-10-29)
- Initial release.
+18 -25
View File
@@ -4,6 +4,10 @@
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`.
- **[OpenAI's GPT](https://openai.com/gpt)**
- **[Anthropic's Claude](https://www.anthropic.com/claude)**
- **[xAI's Grok](https://x.ai/)**
- **[Groq's Groq](https://groq.com/)**
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
import simplemind as sm
```
Authenticate your API keys by setting them in the environment variables:
First, authenticate your API keys by setting them in the environment variables:
```bash
$ export OPENAI_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
import simplemind as sm
```
## 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 lifes 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.
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "simplemind"
version = "0.1.0"
version = "0.1.1"
description = "An experimental client for AI providers that intends to replace LangChain and LangGraph for most common use cases."
readme = "README.md"
requires-python = ">=3.11"
+1 -1
View File
@@ -83,7 +83,7 @@ class Groq(BaseProvider):
{"role": "user", "content": prompt},
]
response = self.structured_client.chat.completions.create(
response = self.client.chat.completions.create(
messages=messages,
model=llm_model,
**kwargs,