- (#changespy)
- (#play_langchainpy)
- (#openai_wrapperpy)
- (#setuppy)
- +291, -0, * 0:
- (https://github.com/idvorkin/nlp/blob/303d7c58265b647dead79ccdbaeafd0cab58d1a0/changes.py)
- Creation of a new Python script to handle Git diffs and summarize changes using OpenAI.
- Major functionalities include:
- Asynchronous retrieval of file diffs from Git using specified commit ranges.
- Summarization of changes in files between two commits.
- Filtering out specific files (e.g., Jupyter notebooks and
back-links.json
). - Environment setup for OpenAI API key from a secrets file.
- Generation of prompts for OpenAI to summarize and rank changes based on impact.
- Command-line interface implementation using Typer for user interaction.
- Functions to interact with Git:
- Retrieval of repository path from Git remote URL.
- Fetching first and last commit hashes within a specified date range.
- Obtaining a list of changed files between two commits.
- Utilities for handling dates and generating summaries:
- Function to calculate tomorrow's date.
- Prompt generation for summarizing and reordering file changes.
- Logging and debugging setup with Loguru and PuDB.
- +5, -129, * 0:
- (https://github.com/idvorkin/nlp/blob/303d7c58265b647dead79ccdbaeafd0cab58d1a0/play_langchain.py)
- Removed imports of
subprocess
,langchain_core.messages.human.HumanMessage
,langchain.agents.AgentType
,langchain.agents.initialize_agent
,langchain.agents.load_tools
, and replacedlangchain_openai.ChatOpenAI
withlangchain_openai.chat_models.ChatOpenAI
and added import oflangchain_google_genai.ChatGoogleGenerativeAI
. - Deleted
financial_agent
command along with its implementation. - Removed the instantiation and usage of
ChatOpenAI
forchat
andchat_model
. - Deleted
changes
command and its comprehensive implementation involving git revision specification and file change summaries. - Replaced
financial_agent
command withtell_me_a_joke
command that usesChatGoogleGenerativeAI
for generating jokes about software engineers based on a specified count.
- +11, -0, * 2
- (https://github.com/idvorkin/nlp/blob/303d7c58265b647dead79ccdbaeafd0cab58d1a0/openai_wrapper.py)
- Added a new utility function
tracer_project_name
to determine the project name based on the caller's file and function.- This involves using the
inspect
module to get the caller's frame and function along with thePath
module to extract the filename.
- This involves using the
- Minor refactoring in
ask_gpt_n
function:- Changed loop variable
x
to_
in list comprehension forresponse_contents
. - Added
type: Ignore
comment to the call toclient.chat.completions.create
and itsmessages
argument to presumably ignore type checking for these lines.
- Changed loop variable
-
- 4, - 0, * 0:
- (https://github.com/idvorkin/nlp/blob/303d7c58265b647dead79ccdbaeafd0cab58d1a0/setup.py)
- Added "play_langchain" and "changes" to the list of packages in the
setup
function. - Included new entry points for "play_langchain" and "changes" in the
entry_points
section.
- +291, -0, * 0:
- (https://github.com/idvorkin/nlp/blob/303d7c58265b647dead79ccdbaeafd0cab58d1a0/changes.py)
- Creation of a new Python script to handle Git diffs and summarize changes using OpenAI.
- Major functionalities include:
- Asynchronous retrieval of file diffs from Git using specified commit ranges.
- Summarization of changes in files between two commits.
- Filtering out specific files (e.g., Jupyter notebooks and
back-links.json
). - Environment setup for OpenAI API key from a secrets file.
- Generation of prompts for OpenAI to summarize and rank changes based on impact.
- Command-line interface implementation using Typer for user interaction.
- Functions to interact with Git:
- Retrieval of repository path from Git remote URL.
- Fetching first and last commit hashes within a specified date range.
- Obtaining a list of changed files between two commits.
- Utilities for handling dates and generating summaries:
- Function to calculate tomorrow's date.
- Prompt generation for summarizing and reordering file changes.
- Logging and debugging setup with Loguru and PuDB.---
- +5, -129, * 0:
- (https://github.com/idvorkin/nlp/blob/303d7c58265b647dead79ccdbaeafd0cab58d1a0/play_langchain.py)
- Removed imports of
subprocess
,langchain_core.messages.human.HumanMessage
,langchain.agents.AgentType
,langchain.agents.initialize_agent
,langchain.agents.load_tools
, and replacedlangchain_openai.ChatOpenAI
withlangchain_openai.chat_models.ChatOpenAI
and added import oflangchain_google_genai.ChatGoogleGenerativeAI
. - Deleted
financial_agent
command along with its implementation. - Removed the instantiation and usage of
ChatOpenAI
forchat
andchat_model
. - Deleted
changes
command and its comprehensive implementation involving git revision specification and file change summaries. - Replaced
financial_agent
command withtell_me_a_joke
command that usesChatGoogleGenerativeAI
for generating jokes about software engineers based on a specified count.---
- +11, -0, * 2
- (https://github.com/idvorkin/nlp/blob/303d7c58265b647dead79ccdbaeafd0cab58d1a0/openai_wrapper.py)
- Added a new utility function
tracer_project_name
to determine the project name based on the caller's file and function.- This involves using the
inspect
module to get the caller's frame and function along with thePath
module to extract the filename.
- This involves using the
- Minor refactoring in
ask_gpt_n
function:- Changed loop variable
x
to_
in list comprehension forresponse_contents
. - Added
type: Ignore
comment to the call toclient.chat.completions.create
and itsmessages
argument to presumably ignore type checking for these lines.---
- Changed loop variable
-
- 4, - 0, * 0:
- (https://github.com/idvorkin/nlp/blob/303d7c58265b647dead79ccdbaeafd0cab58d1a0/setup.py)
- Added "play_langchain" and "changes" to the list of packages in the
setup
function. - Included new entry points for "play_langchain" and "changes" in the
entry_points
section.