Add OpenAI Agent Optimization guide#18792
Conversation
- Introduced a new documentation file for optimizing prompts with OpenAI Agents. - Updated the sidebar configuration to include a new category for "Optimize Prompts" with a link to the new guide. Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds documentation for optimizing prompts with OpenAI Agents. It introduces a new guide demonstrating how to use MLflow's optimize_prompts API with the OpenAI Agent framework to improve agent prompts automatically.
- Adds a new documentation file for OpenAI Agent optimization with a complete working example
- Updates the sidebar to create a nested category structure for "Optimize Prompts" with a link to the new guide
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docs/sidebarsGenAI.ts | Converts the "Optimize Prompts" entry from a single doc link to a nested category containing the new OpenAI Agent optimization guide |
| docs/docs/genai/prompt-registry/optimize-prompts/openai-agent-optimization.mdx | New documentation page with prerequisites, setup instructions, and a complete code example for optimizing OpenAI Agent prompts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
docs/docs/genai/prompt-registry/optimize-prompts/openai-agent-optimization.mdx
Outdated
Show resolved
Hide resolved
|
Documentation preview for c6b6486 is available at: Changed Pages (1)More info
|
|
@TomeHirata Sorry, I accidentally pushed the |
docs/docs/genai/prompt-registry/optimize-prompts/openai-agent-optimization.mdx
Outdated
Show resolved
Hide resolved
docs/docs/genai/prompt-registry/optimize-prompts/openai-agent-optimization.mdx
Outdated
Show resolved
Hide resolved
- Added `nest_asyncio` to the installation instructions for better compatibility in notebook environments. - Clarified the context for using `nest_asyncio` in the example. - Updated the type hint for the `exact_match` function to improve code clarity. Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
ff6818d to
c2ff6b1
Compare
|
|
||
| # Optimizing Prompts for OpenAI Agents | ||
|
|
||
| <p style={{display: 'flex', justifyContent: 'center', margin: '1em 0'}}> |
There was a problem hiding this comment.
nit: the image is truncated, can we fix the stylying?
There was a problem hiding this comment.
Is it truncated by styling? The original picture is this: https://mlflow.org/docs/latest/images/logos/openai-agent-logo.png, which is exactly what's displayed in the doc.
There was a problem hiding this comment.
Can you fix the original image then?
There was a problem hiding this comment.
Yeah, I thought about the same and googled, but couldn't find the original logo. It seems the file was added by you. Where did you find the original logo? I can file a follow-up if we can find the replacement.
docs/docs/genai/prompt-registry/optimize-prompts/openai-agent-optimization.mdx
Outdated
Show resolved
Hide resolved
docs/docs/genai/prompt-registry/optimize-prompts/openai-agent-optimization.mdx
Outdated
Show resolved
Hide resolved
docs/docs/genai/prompt-registry/optimize-prompts/openai-agent-optimization.mdx
Show resolved
Hide resolved
docs/docs/genai/prompt-registry/optimize-prompts/openai-agent-optimization.mdx
Outdated
Show resolved
Hide resolved
| Here's a complete example of optimizing a question-answering agent: | ||
|
|
||
| ```python | ||
| import asyncio |
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com> Signed-off-by: Tian Lan <sky.blue266000@gmail.com>
🛠 DevTools 🛠
Install mlflow from this PR
For Databricks, use the following command:
Related Issues/PRs
n/a
What changes are proposed in this pull request?
We will add pages for how to use
optimize_promptswith major agent frameworks. This PR introduces OpenAI Agent example.How is this PR tested?
Does this PR require documentation update?
Release Notes
Is this a user-facing change?
What component(s), interfaces, languages, and integrations does this PR affect?
Components
area/tracking: Tracking Service, tracking client APIs, autologgingarea/models: MLmodel format, model serialization/deserialization, flavorsarea/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registryarea/scoring: MLflow Model server, model deployment tools, Spark UDFsarea/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflowsarea/gateway: MLflow AI Gateway client APIs, server, and third-party integrationsarea/prompts: MLflow prompt engineering features, prompt templates, and prompt managementarea/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionalityarea/projects: MLproject format, project running backendsarea/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev serverarea/build: Build and test infrastructure for MLflowarea/docs: MLflow documentation pagesHow should the PR be classified in the release notes? Choose one:
rn/none- No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" sectionrn/breaking-change- The PR will be mentioned in the "Breaking Changes" sectionrn/feature- A new user-facing feature worth mentioning in the release notesrn/bug-fix- A user-facing bug fix worth mentioning in the release notesrn/documentation- A user-facing documentation change worth mentioning in the release notesShould this PR be included in the next patch release?
Yesshould be selected for bug fixes, documentation updates, and other small changes.Noshould be selected for new features and larger changes. If you're unsure about the release classification of this PR, leave this unchecked to let the maintainers decide.What is a minor/patch release?
Bug fixes, doc updates and new features usually go into minor releases.
Bug fixes and doc updates usually go into patch releases.