-
Notifications
You must be signed in to change notification settings - Fork 134
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
agentic functions support #652
Conversation
@@ -188,10 +188,10 @@ async function runToolCalls( | |||
const context: ToolCallContext = { | |||
trace, | |||
} | |||
const output = await tool.fn({ context, ...args }) | |||
const output = await tool.impl({ context, ...args }) |
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 method name has been changed from 'fn' to 'impl'. This could potentially break any code that relies on the 'fn' method.
generated by pr-review-commit
method_change
@@ -40,7 +40,7 @@ export const CLIENT_RECONNECT_DELAY = 3000 | |||
export const CLIENT_RECONNECT_MAX_ATTEMPTS = 20 | |||
export const RETRIEVAL_PERSIST_DIR = "retrieval" | |||
export const HIGHLIGHT_LENGTH = 4000 | |||
export const DEFAULT_MODEL = "openai:gpt-4o" | |||
export const DEFAULT_MODEL = "openai:gpt-4" |
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 default model has been changed from 'openai:gpt-4o' to 'openai:gpt-4'. This could potentially affect the performance or behavior of the model.
generated by pr-review-commit
model_change
The pull request introduces several changes in the code, mainly in the naming of certain variables and functions. Here's a breakdown of the primary changes:
In general, the changes seem to be improvements aimed at refining the code, making it more readable, and enhancing the flexibility of certain functions and types. However, without the context of the entire codebase, it's hard to be definitive. Here are a few potential concerns:
Overall, these changes look good. However, it's critical to test these changes thoroughly and ensure that the renaming and new function overload don't cause undesired side effects in the rest of the application. So, considering the above points, I would say "LGTM 🚀", but with a note of caution to thoroughly test the changes before merging.
|
@@ -218,7 +218,7 @@ export async function runScript( | |||
GENAI_ANY_REGEX.test(scriptId) && | |||
resolve(t.filename) === resolve(scriptId)) | |||
) | |||
if (!script) throw new Error(`tool ${scriptId} not found`) | |||
if (!script) throw new Error(`script ${scriptId} not found`) |
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 error message should be "tool" instead of "script" as the context is about finding a tool.
generated by pr-review-commit
incorrect_error_message
if (output === undefined || output === null) | ||
throw new Error( | ||
`tool ${tool.definition.name} output is undefined` | ||
`tool ${tool.spec.name} output is undefined` |
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 error message should be "tool" instead of "script" as the context is about a tool's output.
generated by pr-review-commit
incorrect_error_message
@@ -40,7 +40,7 @@ export const CLIENT_RECONNECT_DELAY = 3000 | |||
export const CLIENT_RECONNECT_MAX_ATTEMPTS = 20 | |||
export const RETRIEVAL_PERSIST_DIR = "retrieval" | |||
export const HIGHLIGHT_LENGTH = 4000 | |||
export const DEFAULT_MODEL = "openai:gpt-4o" | |||
export const DEFAULT_MODEL = "openai:gpt-4" |
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 constant DEFAULT_MODEL should be "openai:gpt-4o" instead of "openai:gpt-4" as per the previous value.
generated by pr-review-commit
incorrect_constant_value
@@ -1,4 +1,3 @@ | |||
import { createProgressSpinner } from "./spinner" | |||
import replaceExt from "replace-ext" |
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.
Missing import statement for createProgressSpinner from "./spinner".
generated by pr-review-commit
missing_import
} | ||
spinner.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.
Missing progress report for jsonl2json function.
generated by pr-review-commit
missing_progress_report
text += `${file}, ${tokens}\n` | ||
} | ||
} | ||
progress.stop() | ||
console.log(text) | ||
} |
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.
Missing progress report for parseTokens function.
generated by pr-review-commit
missing_progress_report
@@ -40,7 +40,7 @@ export const CLIENT_RECONNECT_DELAY = 3000 | |||
export const CLIENT_RECONNECT_MAX_ATTEMPTS = 20 | |||
export const RETRIEVAL_PERSIST_DIR = "retrieval" | |||
export const HIGHLIGHT_LENGTH = 4000 | |||
export const DEFAULT_MODEL = "openai:gpt-4o" | |||
export const DEFAULT_MODEL = "openai:gpt-4" |
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 model name should be "openai:gpt-4o" instead of "openai:gpt-4".
generated by pr-review-commit
incorrect_model_name
definition
has been changed tospec
, andfn
has been adjusted toimpl
. This modifies how tools and functions are defined, resolved, and called throughout the codebase (filesrun.ts
,chat.ts
,promptdom.ts
andrunpromptcontext.ts
are affected).ToolCallback
object instead of separately specifying its name, description, parameters, and implementation (runpromptcontext.ts
andprompt_type.d.ts
changes).ToolCallOutput
type has been expanded to include number and boolean values giving more flexibility to tool function return types (prompt_template.d.ts
.defTool
method that accepts aToolCallback
object (prompt_template.d.ts
andprompt_type.ts
)."openai:gpt-4o"
to"openai:gpt-4"
.defTool
method with aToolCallback
object (agentic-calculator.genai.mts
). This also required additional dependencies (@agentic/calculator
and@agentic/core
) to be added to the project (package.json
).