Skip to content
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

Merged
merged 9 commits into from
Sep 21, 2024
Merged

Add logging to Flo library #21

merged 9 commits into from
Sep 21, 2024

Conversation

thomastomy5
Copy link
Contributor

No description provided.

Copy link
Member

@vizsatiz vizsatiz left a 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/flo.log Outdated Show resolved Hide resolved
flo_ai/common/flo_callback_handler.py Outdated Show resolved Hide resolved
flo_ai/common/flo_logger.py Outdated Show resolved Hide resolved
flo_ai/state/flo_session.py Outdated Show resolved Hide resolved
flo_ai/common/flo_logger.py Outdated Show resolved Hide resolved
vizsatiz
vizsatiz previously approved these changes Sep 17, 2024

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.
Copy link
Member

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 Show resolved Hide resolved
export FLO_LOG_LEVEL_SESSION=WARNING


2. FloSession Creation:
Copy link
Member

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 Show resolved Hide resolved
@@ -0,0 +1,67 @@
# Understanding Log Levels
Copy link
Member

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

Copy link
Member

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/state/flo_session.py Outdated Show resolved Hide resolved
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)
Copy link
Member

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):
Copy link
Member

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 ?

@vizsatiz
Copy link
Member

@thomastomy5 Overall the design is really good!

@vizsatiz vizsatiz changed the title added logging to Flo library Add logging to Flo library Sep 18, 2024
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)
Copy link
Member

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?

flo_ai/state/flo_session.py Outdated Show resolved Hide resolved
vizsatiz
vizsatiz previously approved these changes Sep 21, 2024
Copy link
Member

@vizsatiz vizsatiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@vizsatiz vizsatiz merged commit 869b084 into develop Sep 21, 2024
1 check passed
@vizsatiz vizsatiz deleted the flolog branch September 21, 2024 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants