Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Updating examples with conversation history#25

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gabor-openai merged 2 commits intomainfromdev/steven/clear_messages
Oct 20, 2025

Conversation

@steven10a
Copy link
Collaborator

  • Adding guidance to dev's on conversation history best practices. I.e, don't store user message until guardrails have passed
  • Updated all examples with this best practice
  • Added a brief section in thequickstart.md to explain this
  • Removedstage_name being passed in through the config (dead code no longer used)

CopilotAI review requested due to automatic review settingsOctober 20, 2025 16:56
Copy link

CopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates examples and documentation to implement conversation history best practices, specifically ensuring user messages are only added to conversation history after guardrails pass. The changes also remove deprecatedstage_name configuration that is no longer used.

Key changes:

  • All examples now pass user input inline without mutating message history first
  • Message history is only updated after guardrail validation succeeds
  • Documentation added to explain this pattern and why it prevents blocked messages from polluting context

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
tests/unit/test_runtime.pyAdded tests to verifystage_name parameter is rejected in configuration
src/guardrails/runtime.pyRemovedstage_name fromConfigBundle attributes and stopped passing it torun_guardrails
examples/internal_examples/custom_context.pyUpdated to pass messages inline and only append after guardrails pass
examples/implementation_code/streaming/streaming_completions.pyUpdated with inline message passing pattern and response accumulation
examples/implementation_code/blocking/blocking_completions.pyUpdated with inline message passing pattern
examples/hallucination_detection/run_hallucination_detection.pyUpdated with inline message passing pattern
examples/basic/structured_outputs_example.pyUpdated to useprevious_response_id for conversation history management
examples/basic/pii_mask_example.pyUpdated with inline message passing pattern and moved system message to initial messages list
examples/basic/multiturn_chat_with_alignment.pyUpdated with inline message passing for both initial calls and tool result calls
examples/basic/azure_implementation.pyUpdated with inline message passing pattern
docs/quickstart.mdAdded new section explaining multi-turn conversation best practices

Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.

Copy link

CopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.

@gabor-openaigabor-openai self-requested a reviewOctober 20, 2025 18:01
Copy link
Collaborator

@gabor-openaigabor-openai left a comment

Choose a reason for hiding this comment

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

LGTM thank you

@gabor-openaigabor-openai merged commit77456ce intomainOct 20, 2025
3 checks passed
@gabor-openaigabor-openai deleted the dev/steven/clear_messages branchOctober 20, 2025 18:04
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

@gabor-openaigabor-openaigabor-openai approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@steven10a@gabor-openai

[8]ページ先頭

©2009-2025 Movatter.jp