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

V0.1.4 #4

Merged
merged 7 commits into from
Apr 12, 2024
Merged

V0.1.4 #4

merged 7 commits into from
Apr 12, 2024

Conversation

granawkins
Copy link
Member

No description provided.

@@ -7,15 +7,15 @@ packages=["ragdaemon"]

[project]
name = "ragdaemon"
version = "0.1.3"
version = "0.1.4"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version bump in pyproject.toml matches the version update in ragdaemon/__init__.py. This ensures consistency across the project.

@@ -1 +1 @@
__version__ = "0.1.3"
__version__ = "0.1.4"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correctly updated the version to 0.1.4. This change is necessary for version tracking and package management.

from ragdaemon.annotators.chunker_line import ChunkerLine
from ragdaemon.annotators.chunker_llm import ChunkerLLM
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reordering imports does not affect functionality but adheres to the convention of organizing imports alphabetically. Good for readability and maintenance.

@@ -3,15 +3,15 @@
from pathlib import Path

import networkx as nx
from spice import Spice
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding from spice import Spice directly aligns with the removal of token_counter from ragdaemon.llm, centralizing token counting to the Spice client.

@@ -2,11 +2,12 @@
from pathlib import Path

import networkx as nx
from spice import Spice
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Importing Spice directly in this file, instead of using a custom token_counter function, simplifies the codebase by leveraging existing functionality from the Spice library.

@@ -12,9 +12,9 @@
from spice import Spice
from starlette.templating import Jinja2Templates

from ragdaemon.llm import DEFAULT_COMPLETION_MODEL
from ragdaemon.database import DEFAULT_EMBEDDING_MODEL
from ragdaemon.daemon import Daemon
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing unused imports and reordering them improves code cleanliness and readability.

@@ -128,7 +128,9 @@ def get_context(
# TODO: Compare graph hashes, reconcile changes
context = context_builder
include_context_message = context.render()
include_tokens = token_counter(include_context_message)
include_tokens = self.spice_client.count_tokens(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using self.spice_client.count_tokens directly instead of a custom token_counter function is a good refactor, leveraging the capabilities of the Spice client for token counting.

@@ -1,10 +1,11 @@
import os
from pathlib import Path

from spice import Spice, SpiceError
from spice import Spice
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reordering imports and separating from spice.errors import SpiceError improves the clarity of where specific components are sourced from.

@@ -1,12 +1 @@
import tiktoken


DEFAULT_COMPLETION_MODEL = "gpt-4-0125-preview"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the token_counter function and its dependencies simplifies the module, especially since token counting is now handled by the Spice client directly.

@@ -6,7 +6,6 @@

from ragdaemon.errors import RagdaemonError


mentat_dir_path = Path.home() / ".mentat"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing unnecessary whitespace improves code cleanliness.

@@ -5,7 +5,7 @@ Jinja2==3.1.3
networkx==3.2.1
pytest==8.0.2
pytest-asyncio==0.23.5
spiceai==0.1.9
spiceai==0.1.11
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating the spiceai version in requirements.txt to 0.1.11 matches the version specified in pyproject.toml, ensuring consistency in dependency management.

Copy link

mentatbot bot commented Apr 12, 2024

MENTAT CODE REVIEW IN ACTIVE DEVELOPMENT. Only in use on mentat and internal repos.
Please Reply with feedback.

This pull request effectively updates the project version to 0.1.4 and refactors the codebase to use the Spice client for token counting, removing the now redundant token_counter function. It also includes minor improvements such as reordering imports and removing unnecessary whitespace. These changes collectively streamline the codebase and ensure consistency in versioning and dependency management.

@granawkins granawkins merged commit 05ad909 into main Apr 12, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants