-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add logging to Flo library #21
Conversation
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 will add more comments later
flo_ai/common/README.md
Outdated
|
||
FLO_LOG_LEVEL_COMMON: Controls the level for the "CommonLogs" logger. | ||
FLO_LOG_LEVEL_BUILDER: Controls the level for the "BuilderLogs" logger. | ||
FLO_LOG_LEVEL_SESSION: Controls the level for the "SessionLogs" logger. |
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.
Maybe we can add the definition of what commonlogs, builderlogs and sessionlogs are in this readme
flo_ai/common/README.md
Outdated
export FLO_LOG_LEVEL_SESSION=WARNING | ||
|
||
|
||
2. FloSession Creation: |
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.
Use markdown subheader ## etc
flo_ai/common/README.md
Outdated
@@ -0,0 +1,67 @@ | |||
# Understanding Log Levels |
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.
You can probably copy paste this to an AI prompt and make it better markdown
flo_ai/common/flo.log
Outdated
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.
Remove this file, add the *.log
in .gitignore
flo_ai/core.py
Outdated
def build(session: FloSession, yaml: str): | ||
return Flo(session, to_supervised_team(yaml)) | ||
def build(session: FloSession, yaml: str, log_level: str = "INFO"): | ||
FloLogger.set_log_level("BUILDER", log_level) |
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.
Do we have to reset it here
from langchain.schema import AgentAction, AgentFinish, LLMResult | ||
from flo_ai.common.flo_logger import get_logger | ||
|
||
class FloCallbackHandler(BaseCallbackHandler): |
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.
Why do we have both this and langchain handler ?
@thomastomy5 Overall the design is really good! |
flo_ai/core.py
Outdated
self.runnable: ExecutableFlo = build_supervised_team(session, config) | ||
|
||
FloLogger.set_log_level("COMMON", log_level) | ||
FloLogger.set_log_level("BUILDER", log_level) |
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.
Why dont you use set_global_log_level
?
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.
Looks good
No description provided.