🔄 via changes.py - 2025-01-01
Changes to idvorkin/tony_tesla From [2024-04-20] To [2025-01-02]
Model | Analysis Duration (seconds) | Output Size (KB) |
---|---|---|
gpt-4o-2024-11-20 | 25 | 33.1 |
🔄 via changes.py - 2025-01-01
Changes to idvorkin/tony_tesla From [2024-04-20] To [2025-01-02]
Model | Analysis Duration (seconds) | Output Size (KB) |
---|---|---|
gpt-4o-2024-11-20 | 25 | 33.1 |
Establishment of Coding Standards and Conventions:
Expansion of Tony Assistant Capabilities:
New Blog Functionality:
Transit System Integration:
Journal Management Enhancements:
Testing and Automation Enhancements:
Project Configuration and Setup:
System Prompt and Assistant Configuration Updates:
Documentation and Miscellaneous Updates:
.gitignore
file updated to exclude unnecessary files.Large Data Additions:
CONVENTIONS.md: +293, -0, ~293
TL;DR: Establish comprehensive coding, testing, and debugging conventions for the project.
Define coding conventions to standardize the use of libraries:
ic
for debugging.foo | None
over Optional[str]
.FunctionReturn
for clarity.Enhance code style by encouraging simple, consistent practices:
Streamline testing processes:
Introduce detailed conventions for creating TUI (Text User Interface) applications:
App
classes for layout and actions.Provide debugging best practices using the ic
library:
ic
with print statements for context in test debugging.Outline testing strategies for TUI applications:
pytest-asyncio
for async tests.app.run_test()
context managers.tony.py: +149, -55, ~204
TLDR: Enhance functionality for Tony assistant by adding new commands, improving call parsing, and extending cost breakdown details.
Add new commands to extend Tony's functionality:
debug_loader
: Debug and load Tony assistant configuration with additional state context.last_transcript
: Retrieve and display the transcript of the most recent call.dump_last_call
: Dump the complete raw JSON of the most recent call for debugging purposes.export_vapi_tony_config
: Export the current Tony assistant configuration from VAPI.calls
: Extend call listing to include detailed cost breakdown when requested.local_parse_config
: Parse and debug local Tony assistant configuration files.Improve calls
function by adding a detailed cost breakdown option (--costs
) to display cost components per call and total cost for all calls.
Enhance parse_call
function:
id
, Cost
, CostBreakdown
) to the Call
model to incorporate cost details.Update app
initialization to include no_args_is_help=True
for better user guidance.
Replace local_debug
with local_parse_config
for better clarity and functionality in parsing local configurations.
Refactor file structure and imports:
langchain_core.pydantic_v1
with pydantic
for managing models.typing.Annotated
for type-annotated command options.These changes collectively improve the usability, debugging, and analytics capabilities of the Tony assistant application.
tony_server.py: +224, -76, ~300
TL;DR: Introduced a FastAPI-based server with multiple endpoints, replacing the previous Modal-based implementation. Added functionality for journal management, search, and transit arrivals. Enhanced security and modularity.
/assistant
endpoint to process assistant-related requests with updated context, including PST time and journal content.
/search
endpoint to handle search logic via the Perplexity API, ensuring robust and secure token-based authorization./library-arrivals
endpoint to fetch and return transit arrival data using the OneBusAway API./journal-read
: Fetch and return journal content from Azure Cosmos DB./journal-append
: Append new entries to the journal and update the database.raise_if_not_authorized
to validate API keys in headers.parse_tool_call
and make_vapi_response
for reusability.pyproject.toml: +82, -0, ~82
TL;DR: Introduce a pyproject.toml
configuration file to define the build system, project metadata, dependencies, testing setup, and coverage reporting for the tony_tesla
project.
setuptools
and wheel
for packaging and setuptools.build_meta
as the backend.tony_tesla
), version (0.1.0
), description, authors, license (MIT), and readme file.icecream
, rich
, pydantic
, langchain
, and fastapi
.pytest
, pytest-asyncio
, and textual-dev
.setuptools
with Python modules including tony
, storage
, bus
, blog_server
, and tony_server
.storage
, tony
, bus
) linking to their respective modules.pytest
configurations:
tests/unit
, tests/integration
, tests/e2e
), test file patterns, and test function naming conventions.DeprecationWarning
, UserWarning
) and enable strict asyncio testing.tests/*
and setup.py
.pragma: no cover
, if __name__ == "__main__":
, etc.).modal_readonly/tony_system_prompt.md: +77, -19, ~96
TLDR: Enhanced the system prompt with more detailed instructions for interactions, added content for memorization, emotional states, and journal usage, and updated specific word mappings and card explanations.
blog_server.py: +251, -0, ~251
TL;DR: Introduced a new FastAPI-based blog server to handle blog-related operations like fetching, searching, and retrieving random blog posts.
Implemented endpoints to interact with blog data:
/random_blog
: Fetches a random blog post's content, title, and metadata./blog_info
: Retrieves metadata about all blog posts, including URLs, titles, and descriptions./read_blog_post
: Fetches the content of a blog post by its markdown path or URL./random_blog_url
: Returns only the URL of a randomly selected blog post./blog_search
: Searches blog posts using the Algolia service, excluding specific collections.Added BlogReader
class for handling blog metadata:
back-links.json
from a GitHub repository.Integrated GitHub content retrieval through read_blog_post()
function:
Secured endpoints:
raise_if_not_authorized
.Powered search functionality with Algolia:
Integrated Modal for deployment:
fastapi_app
decorator for seamless deployment of the FastAPI app.bus.py: +247, -0, ~247
TL;DR: Introduce a new script to interact with King County Metro transit data, providing functionalities to fetch, process, and display bus routes, stops, and upcoming arrivals.
Add functionality to load and cache transit data, including routes, stops, and trip updates, using Pydantic models for structured data representation.
get_routes()
, get_stops()
, and get_trip_updates()
parse respective files into structured models and cache the results for efficiency.Implement a command-line interface (CLI) using Typer to provide multiple commands:
stops_for_route
: Display stops and arrival times for a given route number.library
: Retrieve and display the next bus arrivals at a specific library stop.get_latest_data
: Download the latest transit data files asynchronously from King County Metro.Provide logging and debugging support via Loguru and Icecream to handle and debug application behavior effectively.
Introduce asynchronous data fetching with HTTPX to improve the efficiency of downloading large transit data files.
Set up structured logging and error handling with Loguru's @logger.catch()
to capture application errors.
This script facilitates the processing and visualization of real-time transit data for King County Metro buses.
tests/e2e/test_blog_server.py: +244, -0, ~244
TLDR: Add end-to-end tests for blog server API to validate endpoints and ensure proper functionality.
make_request
with retry logic to handle HTTP requests and enhance reliability.
icecream
for debugging.auth_headers
and base_params
to centralize setup for authentication and request payloads.test_random_blog_e2e
to verify "random_blog" endpoint functionality.
test_blog_info_e2e
to validate "blog_info" endpoint.
test_read_blog_post_e2e
to test "read_blog_post" endpoint for individual blog retrieval.
test_random_blog_url_e2e
to check "random_blog_url_only" endpoint.
test_blog_search_e2e
for blog search functionality.
tests/integration/test_blog_handler.py: +170, -0, ~170
TL;DR: Add integration tests for blog-related endpoints to ensure correct functionality of the blog handling system.
/random_blog
endpoint to ensure it returns a non-empty list of blog entries with appropriate fields (content
, title
, url
, markdown_path
)./blog_info
endpoint to confirm it retrieves a list of blog posts with correct structure and metadata, and ensures the presence of at least 100 posts./read_blog_post
endpoint correctly reads blog content:
markdown_path
and URL path./random_blog_url
endpoint returns a valid blog post URL and title, validating the URL format starts with https://idvork.in
./blog_search
endpoint:
ig66
) while still containing relevant data.url
, title
, content
, and collection
.storage.py: +177, -0, ~177
TL;DR: Introduce a new script to manage Azure Cosmos DB storage operations, including file listing and journal management, with CLI commands.
Add CLI functionality using Typer to enable storage and journal management operations.
all_files
, read_journal
, replace_journal
, append_journal
, list_journal
, and clear_journal
.Implement Azure Cosmos DB integration for CRUD operations:
journal_container
).Introduce JournalItemModel
using Pydantic for structured journal data validation.
Provide utilities for journal management:
read_journal
: Fetch and print the current journal content.replace_journal
: Replace journal content with new content from a file, with backup creation.append_journal
: Append a timestamped entry to the journal.list_journal
: List all journal entries.clear_journal
: Clear all content from the journal.Enhance diagnostics and debugging using loguru
for logging and icecream
for structured console outputs.
modal_readonly/tony_assistant_spec.json: +178, -22, ~200
TL;DR: Expanded and upgraded the assistant configuration for enhanced functionality, including new tools, updated models, and improved voice capabilities.
Added multiple tools to extend assistant functionality:
Updated the voice model to "eleven_flash_v2" for improved voice capabilities.
Upgraded the AI model to "gpt-4o-2024-11-20" with additional features:
tools
definition to include detailed configurations and async capabilities.Enabled the endCallFunction
feature, allowing more dynamic call handling.
Retained and slightly reformatted existing features like transcription, end-call phrases, and server messaging for consistency.
Simplified JSON formatting for readability.
tests/e2e/test_tony_server.py: +106, -0, ~106
TLDR: Add end-to-end tests for the Tony Server API endpoints to verify their functionality with real HTTP requests.
make_request
function to handle HTTP requests with error handling and JSON decoding for robust testing.auth_headers
and base_params
fixtures for reusable authentication headers and parameter structures.test_journal_read_e2e
to validate the /journal-read
endpoint response structure and content.test_search_e2e
to test the /search
endpoint using sample tool call parameters and validate the results.test_assistant_e2e
to verify the /assistant
endpoint functionality, particularly the presence and type of the assistant
key in the response.icecream
library for detailed logging and debugging of requests and responses.justfile: +86, -0, ~86
TL;DR: Introduce a justfile
for task automation to simplify development, testing, and deployment workflows.
install
and global-install
).run-dev-server
and run-dev-blog-server
) and deploying production servers (deploy
and deploy-blog
).test-unit
, test-integration
, test-e2e
, etc.) for quick and organized testing.test-assistant
, test-read
, test-append
, etc.).test-coverage
command.deploy-all
command.tests/integration/test_tony_server.py: +104, -0, ~104
TLDR: Add integration tests for tony_server
and blog_server
functionalities to ensure proper behavior of APIs and utility functions.
/search
endpoint of tony_server
to ensure correct handling of tool calls and response structure.parse_tool_call
function directly to confirm it parses tool call data correctly.make_vapi_response
function to verify it generates accurate responses for tool calls.blog_search
endpoint of blog_server
to ensure it processes search queries and returns expected structured results.auth_headers
and base_params
) to standardize test setup, improving code reusability and reducing redundancy.modal_readonly/transit/routes.txt: +151, -0, ~151
TLDR: Add a new file containing transit route information for integration or data analysis purposes.
tests/unit/test_blog_server.py: +100, -0, ~100
TL;DR: Add unit tests for BlogReader
, read_blog_post
function, and UrlInfo
model to verify functionality and edge cases.
read_blog_post
correctly fetches and returns content from a markdown file.BlogReader.get_url_info
retrieves and maps URL information into UrlInfo
objects.UrlInfo
model.BlogReader.url_to_markdown_path
correctly converts URLs to associated markdown paths, including handling edge cases like non-existent or empty URLs.read_blog_post
works with full markdown paths.journal_cleanup.convo.md: +36, -0, ~36
TL;DR: Add a new markdown file outlining a conversational requirement for formatting journal entries consistently.
[TODO]
format.[GRATEFUL]
format.[TODO completed=YYYY-MM-DD]
syntax.[WAKEUP: HH:MM]
.bus_tools.md: +29, -0, ~29
TL;DR: Introduce a new file to provide tools and instructions for adding bus support for Toni, currently limited to Seattle Metro data.
routes.txt
file for context.jq
, simplifying data extraction..pre-commit-config.yaml: +20, -0, ~20
TL;DR: Add pre-commit configuration file to enforce code quality and formatting standards automatically.
--fix
argument for Ruff linter.README.md: +42, -3, ~42
TL;DR: Add a sequence diagram illustrating key interactions within the Tony assistant system.
.gitignore: +4, -0, ~4
TL;DR: Add a .gitignore
file to exclude unnecessary files and directories from version control.
aider
tool by ignoring .aider*
.__pycache__/
.*.egg-info/
..env
.modal_readonly/transit/trips.txt: +5,064,506, -0, ~5,064,506
TL;DR: Added a new massive data file containing transit trip information.
modal_readonly/transit/stops.txt: +617.0KB, -0, ~large file
TL;DR: Added a new file containing transit stops data likely for use in a transportation or mapping feature.
modal_readonly/transit/48_stops.txt: +57, -0, ~0
TLDR: Add a new file to list transit stop identifiers for route 48.
tests/integration/init.py: +1, -0, ~1
TL;DR: Add an __init__.py
file to define the integration
directory as a Python package for integration tests.
integration
directory is recognized as a Python package by adding an __init__.py
file.tests/e2e/init.py: +1, -0, ~1
TL;DR: Add an __init__.py
file to define the tests/e2e
directory as a Python package.
tests/e2e
directory to be recognized as a Python package for organizing end-to-end tests. This is necessary for importing and running tests within the package.tests/unit/init.py: +1, -0, ~1
TL;DR: Create an initialization file for the tests/unit
package, making it a valid Python package.
__init__.py
file to mark the tests/unit
directory as a Python package. This is necessary for proper test discovery and execution.