-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix: added model utils to get the model name #4532
Conversation
CodSpeed Performance ReportMerging #4532 will improve performances by 22.93%Comparing Summary
Benchmarks breakdown
|
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.
I like this.
LGTM
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.
What do you think about adding tests for this function using a few llm components?
Sure! |
c97ca68
to
4c44f3c
Compare
model utils to find model name
updated the logic
df00c80
to
72b2315
Compare
This pull request introduces a new utility function to extract the model name from a language model object and integrates this function into the agent component to enhance model handling.
Key changes include:
New Utility Function:
src/backend/base/langflow/base/models/model_utils.py
: Added aget_model_name
function to extract the model name from a language model object by checking for various attributes or falling back to the class name.Integration of Utility Function:
src/backend/base/langflow/components/agents/agent.py
: Imported theget_model_name
function.src/backend/base/langflow/components/agents/agent.py
: Updated themessage_response
method in theAgentComponent
class to use theget_model_name
function to set the model name.