Skip to content

Commit

Permalink
Merge branch 'main' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
VVoruganti committed Apr 1, 2024
2 parents b0fdf24 + 29cd37b commit c51b85c
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
![GitHub Repo stars](https://img.shields.io/github/stars/plastic-labs/honcho)
[![X (formerly Twitter) URL](https://img.shields.io/twitter/url?url=https%3A%2F%2Ftwitter.com%2Fplastic_labs)](https://twitter.com/plastic_labs)

Honcho is a platform for making AI agents and LLM powered applications that are personalized
to their end users.
Honcho is a platform for making AI agents and LLM powered applications that are personalized
to their end users.

Expand All @@ -25,6 +27,19 @@ Read the user documenation [here](https://docs.honcho.dev)
- [Contributing](#contributing)
- [License](#license)

## Table of Contents

- [Project Structure](#project-structure)
- [Usage](#usage)
- [API](#api)
- [Docker](#docker)
- [Manually](#manually)
- [Deploying on Fly.io](#deploy-on-fly)
- [Client SDK](#client-sdk)
- [Use Locally](#use-locally)
- [Contributing](#contributing)
- [License](#license)

## Project Structure

The Honcho repo is a monorepo containing the server/API that manages database
Expand Down Expand Up @@ -61,6 +76,19 @@ docker compose up -d

#### Manually

#### Docker

The API can be run using docker-compose. The `docker-compose.yml.example` file can be copied to `docker-compose.yml` and the environment variables can be set in the `.env` file.

```bash
cd honcho/api
cp docker-compose.yml.example docker-compose.yml
[ update the file with openai key and other wanted environment variables ]
docker compose up -d
```

#### Manually

The API can be run either by installing the necessary dependencies and then
specifying the appropriate environment variables.

Expand All @@ -75,6 +103,7 @@ poetry install # install dependencies
2. Copy the `.env.template` file and specify the type of database and
connection_uri. For testing sqlite is fine. The below example uses an
in-memory sqlite database.
in-memory sqlite database.

> Honcho has been tested with Postgresql and PGVector
Expand Down Expand Up @@ -103,6 +132,7 @@ python -m uvicorn src.main:app --reload
The API can also be deployed on fly.io. Follow the [Fly.io
Docs](https://fly.io/docs/getting-started/) to setup your environment and the
`flyctl`.
`flyctl`.

Once `flyctl` is set up use the following commands to launch the application:

Expand Down Expand Up @@ -130,6 +160,10 @@ poetry add honcho-ai
checkout the [SDK Reference](https://api.python.honcho.dev) for a detailed
look at the different methods and how to use them.

Also, check out the[example folder](./example/) for examples of how to use the sdk
checkout the [SDK Reference](https://api.python.honcho.dev) for a detailed
look at the different methods and how to use them.

Also, check out the[example folder](./example/) for examples of how to use the sdk

#### Use Locally
Expand All @@ -149,11 +183,13 @@ This project is completely open source and welcomes any and all open source
contributions. The workflow for contributing is to make a fork of the
repository. You can claim an issue in the issues tab or start a new thread to
indicate a feature or bug fix you are working on.
indicate a feature or bug fix you are working on.

Once you have finished your contribution make a PR pointed at the `staging`
branch, and it will be reviewed by a project manager. Feel free to join us in
our [discord](http://discord.gg/plasticlabs) to discuss your changes or get
help.
help.

Once your changes are accepted and merged into staging they will undergo a
period of live testing before entering the upstream into `main`
Expand Down
4 changes: 4 additions & 0 deletions sdk/honcho/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,10 @@ async def init(self):
"""Synonym for initialize"""
await self.initialize()

async def init(self):
"""Synonym for initialize"""
await self.initialize()

@property
def base_url(self):
"""Shortcut for common API prefix. made a property to prevent tampering"""
Expand Down
4 changes: 4 additions & 0 deletions sdk/honcho/sync_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,10 @@ def init(self):
"""Synonym for initialize"""
self.initialize()

def init(self):
"""Synonym for initialize"""
self.initialize()

@property
def base_url(self):
"""Shortcut for common API prefix. made a property to prevent tampering"""
Expand Down
8 changes: 2 additions & 6 deletions sdk/tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,7 @@ def test_paginated_messages():
created_session.create_message(is_user=False, content="Hi")

page_size = 7
get_message_response = created_session.get_messages(
page=1, page_size=page_size
)
get_message_response = created_session.get_messages(page=1, page_size=page_size)

assert get_message_response is not None
assert isinstance(get_message_response, GetMessagePage)
Expand Down Expand Up @@ -448,9 +446,7 @@ def test_collection_query():
collection = user.create_collection(col_name)

# Add documents
doc1 = collection.create_document(
content="The user loves puppies", metadata={}
)
doc1 = collection.create_document(content="The user loves puppies", metadata={})
doc2 = collection.create_document(content="The user owns a dog", metadata={})
doc3 = collection.create_document(content="The user is a doctor", metadata={})

Expand Down

0 comments on commit c51b85c

Please sign in to comment.