-
Notifications
You must be signed in to change notification settings - Fork 129
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
memory cache #760
memory cache #760
Conversation
@@ -137,7 +137,7 @@ defAgent( | |||
system: ["system.explanations", "system.github_info"], | |||
tools: [ | |||
"md_find_files", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be a typo here. The correct function name is "md_read_frontmatter" not "md_read_frontmatterm".
generated by pr-docs-review-commit
typo
The pull request appears to make significant changes to how caching is handled in the TypeScript codebase:
While these changes seem to be logically coherent, here are a few potential concerns:
Overall, the changes look well-implemented and improve the separation of concerns between in-memory and file-based caching. But it's crucial to ensure that the lack of memory management and persistence in So, it's not quite "LGTM 🚀", but it's close – provided that the concerns above are addressed.
|
It seems I can't directly access the content of the file to pinpoint the exact issue. However, based on the error message from the logs:
The problem is that a function call on line 295 of Suggested FixYou'll need to check the function definition that's being called on this line to see which argument is extraneous or if the function needs to be updated to accept three arguments. Here is a possible fix in diff format: --- a/src/openai.ts
+++ b/src/openai.ts
@@ -294,7 +294,7 @@
// some context
- someFunction(arg1, arg2, { trace })
+ someFunction(arg1, { trace }) Make sure to verify which argument needs adjustment based on your specific context. Adjust the function call to meet the expected arguments as per its definition.
|
Here's the analysis:
Root Cause:The error in the failed run is due to a function call in To resolve the issue, ensure that the function calls in
|
Investigation ReportWorkflow Failure Details
Related Commits
Pull Requests and Issues
Code Comparison
ConclusionFurther investigation requires successful retrieval of commit and diff data to pinpoint changes leading to the failure. Please ensure access to the relevant tools and data systems for complete analysis.
|
@@ -118,22 +101,22 @@ export class JSONLineCache<K, V> extends EventTarget { | |||
return this._entries[sha]?.val | |||
} | |||
|
|||
protected async appendEntry(entry: CacheEntry<K, V>) {} | |||
|
|||
/** | |||
* Set a key-value pair in the cache, triggering a change event. | |||
* @param key - The key to set | |||
* @param val - The value to set | |||
* @param options - Optional trace options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The set
method in the MemoryCache
class no longer accepts a TraceOptions
parameter, which could lead to issues if tracing is required in the future. Consider adding it back.
generated by pr-review-commit
missing_trace_option
*/ | ||
export class JSONLineCache<K, V> extends MemoryCache<K, V> { | ||
// Constructor is private to enforce the use of byName factory method | ||
protected constructor(public readonly name: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The set
method in the JSONLineCache
class no longer accepts a TraceOptions
parameter, which could lead to issues if tracing is required in the future. Consider adding it back.
generated by pr-review-commit
missing_trace_option
@@ -289,11 +289,7 @@ export const OpenAIChatCompletion: ChatCompletionHandler = async ( | |||
} | |||
|
|||
if (done && finishReason === "stop") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The set
method call in OpenAIChatCompletion
no longer passes a TraceOptions
parameter, which could lead to issues if tracing is required in the future. Consider adding it back.
generated by pr-review-commit
missing_trace_option
🔧 A new class
MemoryCache
is introduced inpackages/core/src/cache.ts
which provides a key-value caching functionality. This class was then extended by the existingJSONLineCache
class, allowing for more modular code.🔄 Refactoring has been done to change the private properties and methods in
JSONLineCache
to protected, allowing access in child classes.🔨 The
memorycache
andworkspacecache
naming conventions are now being utilized in methods withinMemoryCache
andJSONLineCache
respectively.☑️ The
JSONLineCache
andMemoryCache
classes have been implemented inpackages/core/src/filesystem.ts
&packages/core/src/promptcontext.ts
to provide caching functionality.📝 The explanation has been updated in the user facing file
packages/core/src/types/prompt_template.d.ts
to specify the new distinction between a file-backed key-value cache (WorkspaceFileCache
) and an in-memory key-value cache.⬆️ Upgrades have been made to several dependency packages as seen by changes in the versions in the comparison.
📚 Documentation within the
system.mdx
has been rectified.⌨️ The GPT-3 encoder in playground is updated to GPT-4 mini, and some logging messages have been updated within the cache script in the
cache.genai.mts
file.🧹 There are minimal removals of unnecessary imports such as
is-path-inside
from the ESlint package.Note: Remember to always test software changes before merging to ensure no breaking changes have been introduced.