-
Notifications
You must be signed in to change notification settings - Fork 126
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
cache #636
cache #636
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,6 @@ | |
maxCachedTemperature = MAX_CACHED_TEMPERATURE, | ||
maxCachedTopP = MAX_CACHED_TOP_P, | ||
cache: useCache, | ||
cacheName, | ||
retry, | ||
retryDelay, | ||
maxDelay, | ||
|
@@ -68,7 +67,7 @@ | |
const { model } = parseModelIdentifier(req.model) | ||
const encoder = await resolveTokenEncoder(model) | ||
|
||
const cache = getChatCompletionCache(cacheName) | ||
const cache = getChatCompletionCache() | ||
Check failure on line 70 in packages/core/src/openai.ts GitHub Actions / build
Check failure on line 70 in packages/core/src/openai.ts GitHub Actions / build
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The function
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The function call
|
||
const caching = | ||
useCache === true || // always use cache | ||
(useCache !== false && // never use cache | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { executeChatSession, tracePromptResult } from "./chat" | ||
import { Project, PromptScript } from "./ast" | ||
import { stringToPos } from "./parser" | ||
import { arrayify, assert, logVerbose, relativePath } from "./util" | ||
import { arrayify, assert, logError, logVerbose, relativePath } from "./util" | ||
import { runtimeHost } from "./host" | ||
import { applyLLMDiff, applyLLMPatch, parseLLMDiffs } from "./diff" | ||
import { MarkdownTrace } from "./trace" | ||
|
@@ -327,6 +327,7 @@ | |
if (oannotations) annotations = oannotations.slice(0) | ||
} | ||
} catch (e) { | ||
logError(e) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An error is logged but not handled. This could lead to unexpected behavior or crashes. Consider throwing the error after logging, or handle it appropriately.
|
||
trace.error(`output processor failed`, e) | ||
} finally { | ||
trace.endDetails() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -618,7 +618,7 @@ | |
|
||
type MakeOptional<T, P extends keyof T> = Partial<Pick<T, P>> & Omit<T, P> | ||
|
||
type PromptArgs = Omit<PromptScript, "text" | "id" | "jsSource" | "activation"> | ||
type PromptArgs = Omit<PromptScript, "text" | "id" | "jsSource" | "activation", "cacheName"> | ||
Check failure on line 621 in packages/core/src/types/prompt_template.d.ts GitHub Actions / build
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The type
|
||
|
||
type PromptSystemArgs = Omit< | ||
PromptArgs, | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 function
getChatCompletionCache
has been modified to no longer accept an argument. This could potentially break any existing calls to this function that are passing an argument.