-
-
Notifications
You must be signed in to change notification settings - Fork 58
Update System Prompt & Improve As-Readable Logic #547
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…nterpret_model parameter
… in OpenAIChatCompletionEndPoint
…and improve offset validation
… chat model handling
…ter notebook detection
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Description: Update System Prompt & Improve As-Readable Logic
Overview
This pull request updates our system prompt across LionAGI, integrates a more robust
as_readable
approach for displaying nested data, and addresses miscellaneous fixes in theReAct
flow, interpret actions, and error handling inAPICalling
.Key Changes
System Prompt Enhancement
LION_SYSTEM_MESSAGE
inlionagi/session/prompts.py
, describing the LionAGI vocabulary and design principles.use_lion_system_message
flag inBranch.__init__()
, allowing the developer to prepend the Lion system message automatically.as_readable
&as_readable_json
Improvementslionagi/libs/schema/as_readable.py
to handle:format_dict
) vs. JSON output.|
) for YAML-like output.ReAct
Flow EnhancementsReAct.py
now prints intermediate analyses usingas_readable
, with optional markdown, curly-based or JSON-based formatting.verbose_length
parameter to truncate overly lengthy chain-of-thought logs, avoiding huge console prints.Interpret & Parse Adjustments
interpret()
can specifyinterpret_model
for an alternative chat model.parse.py
to handleInterruptedError
and stricter use of partial results if an LLM conversation is canceled mid-parse.APICalling
Cancellation Handling_inner()
and_stream()
methods more cleanly raiseasyncio.CancelledError
when user or environment cancels.Miscellaneous
0.8.8
to0.9.0
.Files Changed
lionagi/libs/schema/as_readable.py
lionagi/operations/ReAct/ReAct.py
as_readable
.lionagi/operations/_act/act.py
lionagi/operations/interpret/interpret.py
interpret_model
usage.lionagi/service/endpoints/base.py
_inner
with explicitCancelledError
re-raising.lionagi/session/branch.py
use_lion_system_message
flag, updated handling of system prompts.lionagi/session/prompts.py
(new)lionagi/version.py
&pyproject.toml
0 10000 .9.0
.Testing & Validation
tests/libs/utils/test_as_readable.py
, ensuring correct multiline string formatting and custom kwargs handling.ReAct
steps output truncated chain-of-thought logs whenverbose_length
is provided.interpret
steps accept optional model overrides without breaking defaults.branch.communicate
,branch.operate
,branch.ReAct
) to confirm no regressions.We appreciate your review and feedback!
This PR should provide better system-level clarity via the new system prompt, improved debug/tracing with refined
as_readable
, and more robust cancellation handling in the event loop.