Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.0.5] - 03-14-2024 Dialectic Agent #38

Merged
merged 77 commits into from
Mar 14, 2024
Merged
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
5341ebf
🧪 asyncify tests
hyusap Jan 31, 2024
942137f
✨ asyncify client
hyusap Jan 31, 2024
387fb66
Basic Test for Page based pagination
VVoruganti Feb 6, 2024
410f914
add sync buildstep and client
hyusap Feb 6, 2024
4495fdf
add vscode DX
hyusap Feb 6, 2024
6033f71
Added Testing for generators and updated examples
VVoruganti Feb 6, 2024
2a3d9f7
feat: example updates
vintrocode Feb 7, 2024
1c9ee99
Merge pull request #10 from plastic-labs/vscode
VVoruganti Feb 7, 2024
d59e1ee
readme exists now
vintrocode Feb 7, 2024
4f650d3
Stylistic changes and generic message
VVoruganti Feb 8, 2024
31d895f
Merge pull request #13 from plastic-labs/vineeth/dev-153
VVoruganti Feb 8, 2024
74199c1
Merge branch 'staging' into ayush/dev-153
VVoruganti Feb 8, 2024
785dd36
Merge pull request #8 from plastic-labs/ayush/dev-153
VVoruganti Feb 8, 2024
870995d
Merge pull request #12 from plastic-labs/vince/example-updates
VVoruganti Feb 8, 2024
0438edb
Merge branch 'staging' into vineeth/dev-154
VVoruganti Feb 8, 2024
8a750a6
Merge pull request #11 from plastic-labs/vineeth/dev-154
VVoruganti Feb 8, 2024
3fd1bf9
Metamessages with other refactoring - untested
VVoruganti Feb 8, 2024
3926aaf
Work with unit tests
VVoruganti Feb 8, 2024
ddaa311
Fix Examples
VVoruganti Feb 8, 2024
a7373d1
MEME-78 Update Changelogs
VVoruganti Feb 8, 2024
f99f1e8
Docstrings to client
VVoruganti Feb 8, 2024
061dd83
Merge pull request #14 from plastic-labs/vineeth/dev-181
VVoruganti Feb 8, 2024
716e8ca
🧪 autogenerate sync tests
hyusap Feb 14, 2024
735d780
test one
hyusap Feb 14, 2024
783156f
add db type
hyusap Feb 14, 2024
287db71
sync client
hyusap Feb 14, 2024
811c726
add status badge
hyusap Feb 14, 2024
cb42724
add coverage
hyusap Feb 14, 2024
77f180a
add file
hyusap Feb 14, 2024
f359be4
give perms
hyusap Feb 14, 2024
178b488
properly output coverage
hyusap Feb 14, 2024
18241c9
split test and coverage
hyusap Feb 14, 2024
555c848
rename action
hyusap Feb 14, 2024
fcde94e
🧪 autogenerate sync tests (#16)
hyusap Feb 15, 2024
8421fda
Vector Support (#18)
VVoruganti Feb 15, 2024
e8730df
Merge branch 'main' into staging
VVoruganti Feb 15, 2024
6c4cfe1
Merge branch 'main' into staging
VVoruganti Feb 21, 2024
614242b
Add reverse parameters for paginated routes
VVoruganti Feb 21, 2024
ef636ce
Address dependabot
VVoruganti Feb 21, 2024
10b65b2
Formatting
VVoruganti Feb 21, 2024
f82bd7f
initial commit on honcho dspy personas
vintrocode Feb 20, 2024
53d952f
working, hit token limit and can't test dspy optimization
vintrocode Feb 20, 2024
8c5845f
initial version working, need to test optimization
vintrocode Feb 21, 2024
07651cb
optimizers working, but appending any example
vintrocode Feb 22, 2024
364ba9a
ready for user object (tbomk)
vintrocode Feb 22, 2024
197a658
Merge branch 'actions' into staging
hyusap Feb 22, 2024
ad4cec3
Revert "add test actions and coverage"
hyusap Feb 22, 2024
794a38f
Merge pull request #28 from plastic-labs/revert-17-actions
hyusap Feb 22, 2024
dee6ba7
Refactor to add User and App Tables
VVoruganti Feb 22, 2024
569870c
User Object passing test cases
VVoruganti Feb 22, 2024
0f783c3
Update examples
VVoruganti Feb 22, 2024
9abafa7
DSPy Todo and documentation updates
VVoruganti Feb 22, 2024
c584fad
Add is_active filtering
VVoruganti Feb 22, 2024
67b1601
Add is_active filtering to the generator
VVoruganti Feb 22, 2024
876e8e8
Fix update user metadata
VVoruganti Feb 22, 2024
cf79652
working, but weird compiler error
vintrocode Feb 23, 2024
3a2f5ea
fixed str error in optimizer
vintrocode Feb 23, 2024
21c325b
ship
vintrocode Feb 23, 2024
122d37d
Merge branch 'main' into staging
VVoruganti Feb 26, 2024
b78d502
sentry
VVoruganti Feb 27, 2024
6714d25
Open Telemetry
VVoruganti Feb 28, 2024
da5f555
optional logging with environment variables
VVoruganti Feb 29, 2024
f40ec07
add actions again? (#29)
hyusap Mar 6, 2024
c1c35de
⚙️ chore: update start script in VS Code to include poetry install --…
hyusap Mar 6, 2024
8be7a9e
Refactored code but need to tweak asyncpg
VVoruganti Feb 29, 2024
a46fa2b
Working Async API using Psycopg3
VVoruganti Mar 6, 2024
9be9c1b
Update Workflow Connection URI
VVoruganti Mar 6, 2024
0e6b56a
Update Workflow Connection URI in coverage test as well
VVoruganti Mar 6, 2024
8258933
Skeleton for Dialectic API
VVoruganti Mar 8, 2024
bf6c1a7
Fixes DEV-217 URL Encoding
VVoruganti Mar 12, 2024
b5935ec
Add Built-in Langchain Utility function
VVoruganti Mar 12, 2024
29b9365
Sphinx Docs MVP
VVoruganti Mar 13, 2024
c4b0151
Metadata filtering for all fixes dev-261
VVoruganti Mar 14, 2024
d59ea18
Basic Dialectic Endpoint fixes dev-253
VVoruganti Mar 14, 2024
52233ef
Working Fact Deriver
VVoruganti Mar 14, 2024
37634b5
0.0.5 Docs and README updates
VVoruganti Mar 14, 2024
09b3e31
Cloudflare Sphinx
VVoruganti Mar 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into staging
VVoruganti committed Feb 15, 2024
commit e8730df829118f4a32db1e09227229f5d66937b6
322 changes: 148 additions & 174 deletions api/poetry.lock

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions api/src/crud.py
Original file line number Diff line number Diff line change
@@ -60,7 +60,6 @@ def update_session(
honcho_session.h_metadata = session.metadata
db.commit()
db.refresh(honcho_session)
copy = get_session(db, app_id=app_id, session_id=session_id, user_id=user_id)
return honcho_session

def delete_session(db: Session, app_id: str, user_id: str, session_id: uuid.UUID) -> bool:
@@ -385,17 +384,3 @@ def delete_document(db: Session, app_id: str, user_id: str, collection_id: uuid.
db.commit()
return True

def get_message(
db: Session, app_id: str, user_id: str, session_id: uuid.UUID, message_id: uuid.UUID
) -> Optional[models.Message]:
# session = get_session(db, app_id=app_id, session_id=session_id, user_id=user_id)
# if session is None:
# raise ValueError("Session not found or does not belong to user")
stmt = (
select(models.Message)
.join(models.Session, models.Session.id == models.Message.session_id)
.where(models.Session.app_id == app_id)
.where(models.Session.user_id == user_id)
.where(models.Message.session_id == session_id)
.where(models.Message.id == message_id)

2 changes: 1 addition & 1 deletion example/discord/simple-roast-bot/README.md
Original file line number Diff line number Diff line change
@@ -39,4 +39,4 @@ If you're not running Honcho locally, you can run the bot with the following com
python main.py
```

If you are interested in running Honcho locally, follow the setup instructions at the root of this repo.
If you are interested in running Honcho locally, follow the setup instructions at the root of this repo.
2 changes: 1 addition & 1 deletion sdk/honcho/client.py
Original file line number Diff line number Diff line change
@@ -434,6 +434,7 @@ def __str__(self):
"""String representation of Session"""
return f"AsyncSession(id={self.id}, app_id={self.app_id}, user_id={self.user_id}, location_id={self.location_id}, metadata={self.metadata}, is_active={self.is_active})"


@property
def is_active(self):
"""Returns whether the session is active - made property to prevent tampering"""
@@ -608,7 +609,6 @@ async def update(self, metadata: Dict):
Args:
metadata (Dict): The Session object containing any new metadata


Returns:
boolean: Whether the session was successfully updated
"""
1 change: 1 addition & 0 deletions sdk/honcho/schemas.py
Original file line number Diff line number Diff line change
@@ -36,3 +36,4 @@ def __init__(self, id: uuid.UUID, collection_id: uuid.UUID, content: str, metada

def __str__(self) -> str:
return f"Document(id={self.id}, metadata={self.metadata}, content={self.content}, created_at={self.created_at})"

30 changes: 15 additions & 15 deletions sdk/honcho/sync_client.py
Original file line number Diff line number Diff line change
@@ -98,13 +98,13 @@ def __init__(self, session, options: Dict, response: Dict) -> None:

Args:
session (Session): Session the returned messages are associated with
options (Dict): Options for the request used mainly for next() to filter queries. The two parameters available are message_id and metamessage_type which are both required
options (Dict): Options for the request used mainly for next() to filter queries. The two parameters available are message_id and metamessage_type which are both optional
response (Dict): Response from API with pagination information
"""
super().__init__(response)
self.session = session
self.message_id = options["message_id"]
self.metamessage_type = options["metamessage_type"]
self.message_id = options["message_id"] if "message_id" in options else None
self.metamessage_type = options["metamessage_type"] if "metamessage_type" in options else None
self.items = [
Metamessage(
id=metamessage["id"],
@@ -150,7 +150,7 @@ def __init__(self, collection, response: Dict) -> None:
def next(self):
"""Get the next page of results
Returns:
GetSessionPage | None: Next Page of Results or None if there are no more sessions to retreive from a query
GetDocumentPage | None: Next Page of Results or None if there are no more sessions to retreive from a query
"""
if self.page >= self.pages:
return None
@@ -184,7 +184,7 @@ def __init__(self, client, options: Dict, response: Dict):
def next(self):
"""Get the next page of results
Returns:
GetSessionPage | None: Next Page of Results or None if there are no more sessions to retreive from a query
GetCollectionPage | None: Next Page of Results or None if there are no more sessions to retreive from a query
"""
if self.page >= self.pages:
return None
@@ -309,7 +309,7 @@ def create_session(
)

def create_collection(
self, user_id, name: str,
self, user_id: str, name: str,
):
"""Create a collection for a user

@@ -335,7 +335,7 @@ def create_collection(
)

def get_collection(self, user_id: str, name: str):
"""Get a specific collection for a user by ID
"""Get a specific collection for a user by name

Args:
user_id (str): The User ID representing the user, managed by the user
@@ -361,7 +361,7 @@ def get_collections(self, user_id: str, page: int = 1, page_size: int = 50):
"""Return collections associated with a user paginated

Args:
user_id (str): The User ID representing the user
user_id (str): The User ID representing the user to get the collection for
page (int, optional): The page of results to return
page_size (int, optional): The number of results to return

@@ -412,7 +412,7 @@ def __init__(
location_id: str,
metadata: dict,
is_active: bool,
created_at
created_at: datetime.datetime
):
"""Constructor for Session"""
self.base_url: str = client.base_url
@@ -434,6 +434,7 @@ def __str__(self):
"""String representation of Session"""
return f"Session(id={self.id}, app_id={self.app_id}, user_id={self.user_id}, location_id={self.location_id}, metadata={self.metadata}, is_active={self.is_active})"


@property
def is_active(self):
"""Returns whether the session is active - made property to prevent tampering"""
@@ -518,7 +519,7 @@ def create_metamessage(self, message: Message, metamessage_type: str, content: s

Args:
message (Message): A message to associate the metamessage with
metamessage_type (str): The type of the metamessage arbitrary itentifier
metamessage_type (str): The type of the metamessage arbitrary identifier
content (str): The content of the metamessage

Returns:
@@ -608,7 +609,6 @@ def update(self, metadata: Dict):
Args:
metadata (Dict): The Session object containing any new metadata


Returns:
boolean: Whether the session was successfully updated
"""
@@ -682,8 +682,8 @@ def create_document(self, content: str, metadata: Dict = {}):
"""Adds a document to the collection

Args:
metadata (Dict): The metadata of the document
content (str): The content of the document
metadata (Dict): The metadata of the document

Returns:
Document: The Document object of the added document
@@ -764,8 +764,8 @@ def get_documents_generator(self):
def query(self, query: str, top_k: int = 5) -> List[Document]:
"""query the documents by cosine distance
Args:
query (str): The query to run
top_k (int, optional): The number of results to return. Defaults to 5.
query (str): The query string to compare other embeddings too
top_k (int, optional): The number of results to return. Defaults to 5 max 50

Returns:
List[Document]: The response from the query with matching documents
@@ -785,7 +785,7 @@ def query(self, query: str, top_k: int = 5) -> List[Document]:
]
return data

def update_document(self, document: Document, metadata: Optional[Dict], content: Optional[str]) -> Document:
def update_document(self, document: Document, content: Optional[str], metadata: Optional[Dict]) -> Document:
"""Update a document in the collection

Args:
1 change: 1 addition & 0 deletions sdk/tests/test_async.py
Original file line number Diff line number Diff line change
@@ -365,3 +365,4 @@ async def test_collection_query():
assert result is not None
assert len(result) == 2
assert isinstance(result[0], Document)

3 changes: 2 additions & 1 deletion sdk/tests/test_sync.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from honcho import GetSessionPage, GetMessagePage, GetMetamessagePage, Session, Message, Metamessage, GetDocumentPage, Document
from honcho import GetSessionPage, GetMessagePage, GetMetamessagePage, GetDocumentPage, Session, Message, Metamessage, Document
from honcho import Client as Honcho
from uuid import uuid1

@@ -348,3 +348,4 @@ def test_collection_query():
assert result is not None
assert len(result) == 2
assert isinstance(result[0], Document)

You are viewing a condensed version of this merge commit. You can view the full changes here.