merge main#25616
Conversation
…hardening Port security fixes from litellm_v1.82.3.dev.6: - Use secureStorage (sessionStorage wrapper) instead of raw storage for tokens - Add URL validation for stored worker URLs to prevent open redirects - Add same-origin checks before redirecting to stored return URLs - Harden Dockerfile.health_check with non-root user and exec-form HEALTHCHECK
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Dockerfile.health_check: HEALTHCHECK now verifies the script is intact instead of unconditionally exiting 0 - secureStorage.ts: replace deprecated escape/unescape with encodeURIComponent/decodeURIComponent; don't delete legacy values on decode failure so in-flight flows can time out naturally - OAuth callback: add same-origin check before redirecting to stored return URL
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…s in encrypted_content_affinity_check (#25347) Using setdefault('litellm_metadata', {}) unconditionally created an empty litellm_metadata key for chat completions and embeddings. This caused _get_metadata_variable_name_from_kwargs to return 'litellm_metadata' instead of 'metadata', so tag-based routing looked for tags in the wrong dict and ignored all tag filters. Fix: only set the encrypted_content_affinity_enabled flag when litellm_metadata already exists (Responses API path). Chat completions and embeddings never have this key, so nothing is created and tag routing works correctly.
#25345) * feat(triton): add embedding usage estimation for self-hosted responses Populate Triton embedding usage from request input using token counting with a safe fallback so cost/observability flows work even when provider usage is missing. Made-with: Cursor * fix(triton): sum per-input embedding token counts for batches Joining batch strings with newlines before token_counter added spurious tokens. Count each input separately and sum, matching OpenAI-style usage. Made-with: Cursor
…xed model names (#25334) Fixes 'LLM Provider NOT provided' errors when models are configured with custom_llm_provider but model names lack provider prefix (e.g., 'gpt-4.1-mini' instead of 'azure/gpt-4.1-mini'). Changes: - Router now passes deployment's custom_llm_provider to get_llm_provider() - Fixes 6 code paths: file creation, file content, batch operations, vector store - Adds regression tests for file creation and file content operations Made-with: Cursor
* fix(vertex_ai): support pluggable (executable) credential_source for WIF auth (#24700) The WIF credential dispatch in load_auth() only handled identity_pool and aws credential types. When credential_source.executable was present (used for Azure Managed Identity via Workload Identity Federation), it fell through to identity_pool.Credentials which rejected it with MalformedError. Add dispatch to google.auth.pluggable.Credentials for executable-type credential sources, following the same pattern as the existing identity_pool and aws helpers. Fixes authentication for Azure Container Apps → GCP Vertex AI via WIF with executable credential sources. * feat(logging): add component and logger fields to JSON logs for 3rd p… (#24447) * feat(logging): add component and logger fields to JSON logs for 3rd party filtering * Let user-supplied extra fields win over auto-generated component/logger, tighten test assertions * Feat - Add organization into the metrics metadata for org_id & org_alias (#24440) * Add org_id and org_alias label names to Prometheus metric definitions * Add user_api_key_org_alias to StandardLoggingUserAPIKeyMetadata * Populate user_api_key_org_alias in pre-call metadata * Pass org_id and org_alias into per-request Prometheus metric labels * Add test for org labels on per-request Prometheus metrics * chore: resolve test mockdata * Address review: populate org_alias from DB view, add feature flag, use .get() for org metadata * Add org labels to failure path and verify flag behavior in test * Fix test: build flag-off enum_values without org fields * Gate org labels behind feature flag in get_labels() instead of static metric lists * Scope org label injection to metrics that carry team context, remove orphaned budget label defs, add test teardown * Use explicit metric allowlist for org label injection instead of team heuristic * Fix duplicate org label guard, move _org_label_metrics to class constant * Reset custom_prometheus_metadata_labels after duplicate label assertion * fix: emit org labels by default, remove flag, fix missing org_alias in all metadata paths * fix: emit org labels by default, no opt-in flag required * fix: write org_alias to metadata unconditionally in proxy_server.py * fix: 429s from batch creation being converted to 500 (#24703) * add us gov models (#24660) * add us gov models * added max tokens * Litellm dev 04 02 2026 p1 (#25052) * fix: replace hardcoded url * fix: Anthropic web search cost not tracked for Chat Completions The ModelResponse branch in response_object_includes_web_search_call() only checked url_citation annotations and prompt_tokens_details, missing Anthropic's server_tool_use.web_search_requests field. This caused _handle_web_search_cost() to never fire for Anthropic Claude models. Also routes vertex_ai/claude-* models to the Anthropic cost calculator instead of the Gemini one, since Claude on Vertex uses the same server_tool_use billing structure as the direct Anthropic API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix(anthropic): pass logging_obj to client.post for litellm_overhead_time_ms (#24071) When LITELLM_DETAILED_TIMING=true, litellm_overhead_time_ms was null for Anthropic because the handler did not pass logging_obj to client.post(), so track_llm_api_timing could not set llm_api_duration_ms. Pass logging_obj=logging_obj at all four post() call sites (make_call, make_sync_call, acompletion, completion). Add test to ensure make_call passes logging_obj to client.post. Made-with: Cursor * sap - add additional parameters for grounding - additional parameter for grounding added for the sap provider * sap - fix models * (sap) add filtering, masking, translation SAP GEN AI Hub modules * (sap) add tests and docs for new SAP modules * (sap) add support of multiple modules config * (sap) code refactoring * (sap) rename file * test(): add safeguard tests * (sap) update tests * (sap) update docs, solve merge conflict in transformation.py * (sap) linter fix * (sap) Align embedding request transformation with current API * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) mock commit * (sap) run black formater * (sap) add literals to models, add negative tests, fix test for tool transformation * (sap) fix formating * (sap) fix models * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) commit for rerun bot review * (sap) minor improve * (sap) fix after bot review * (sap) lint fix * docs(sap): update documentation * fix(sap): change creds priority * fix(sap): change creds priority * fix(sap): fix sap creds unit test * fix(sap): linter fix * fix(sap): linter fix * linter fix * (sap) update logic of fetching creds, add additional tests * (sap) clean up code * (sap) fix after review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) add a possibility to put the service key by both variants * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) update test * (sap) update service key resolve function * (sap) run black formater * (sap) fix validate credentials, add negative tests for credential fetching * (sap) fix validate credentials, add negative tests for credential fetching * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) fix after bot review * (sap) lint fix * (sap) lint fix * feat: support service_tier in gemini * chore: add a service_tier field mapping from openai to gemini * fix: use x-gemini-service-tier header in response * docs: add service_tier to gemini docs * chore: add defaut/standard mapping, and some tests * chore: tidying up some case insensitivity * chore: remove unnecessary guard * fix: remove redundant test file * fix: handle 'auto' case-insensitively * fix: return service_tier on final steamed chunk * chore: black * feat: enable supports_service_tier to gemini models * Fix get_standard_logging_metadata tests * Fix test_get_model_info_bedrock_models * Fix test_get_model_info_bedrock_models * Fix remaining tests * Fix mypy issues * Fix tests * Fix merge conflicts * Fix code qa * Fix code qa * Fix code qa * Fix greptile review --------- Co-authored-by: michelligabriele <gabriele.michelli@icloud.com> Co-authored-by: Josh <36064836+J-Byron@users.noreply.github.com> Co-authored-by: mubashir1osmani <mubashir.osmani777@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: milan-berri <milan@berri.ai> Co-authored-by: Alperen Kömürcü <alperen.koemuercue@sap.com> Co-authored-by: Vasilisa Parshikova <vasilisa.parshikova@sap.com> Co-authored-by: Lin Xu <lin.xu03@sap.com> Co-authored-by: Mark McDonald <macd@google.com> Co-authored-by: Sameer Kankute <sameer@berri.ai>
Add Baseten Model API pricing entries for Nemotron, GLM, Kimi, GPT OSS, and DeepSeek models with validated model slugs. Include a focused regression test to assert provider and per-token pricing values. Made-with: Cursor
Remove the silent try/catch from setSecureItem so OAuth hooks can surface actionable "enable storage" guidance instead of a cryptic "state lost" error after the round-trip. Add a local try/catch in ChatUI where the storage write is non-critical.
Replace Tremor components in the regenerate key modal with Ant Design equivalents and move the component to a new PascalCase file. The form layout now uses Row/Col to place Max Budget, TPM Limit, and RPM Limit on one row and Expire Key with Grace Period on another, reducing the vertical footprint. The success view shows an Alert banner, the key alias as secondary context, and the regenerated key in a monospace block with an inline primary Copy button. Also adds unit tests for the new component and updates the existing Playwright spec to match the new banner and button text.
…am=True The deployment hook now converts stream=True→False in wrapper_async's scope so the streaming early-return path is skipped and logging executes. logging_obj.stream is synced after the hook, and the original stream intent is recovered for the short-circuit path. Made-with: Cursor
…loyment best practices (#25439) - New doc page covering all signed image variants, verification commands, CI/CD enforcement (K8s Sigstore Policy Controller, GCP Binary Authorization, AWS/EKS, GitHub Actions), digest pinning, and safe upgrade patterns - Added to sidebar under Setup & Deployment - Cross-linked from the existing deploy.md cosign section Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
- Introduced `afile_content_streaming` and `file_content_streaming` functions in `litellm/files/main.py` to handle asynchronous and synchronous file content streaming. - Added `FileContentStreamingResponse` class in `litellm/files/streaming.py` to manage streaming responses with logging capabilities. - Updated OpenAI API integration in `litellm/llms/openai/openai.py` to support new streaming methods. - Enhanced file content retrieval in `litellm/proxy/openai_files_endpoints/files_endpoints.py` to route requests for streaming. - Added unit tests for the new streaming functionality in `tests/test_litellm/llms/openai/test_openai_file_content_streaming.py` and `tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py`. - Refactored type hints and imports for better clarity and organization across modified files.
…_model_test fix(test): mock headers in test_completion_fine_tuned_model
…ip check - Drop module-level common_utils import; import team helpers inside callers. - Inline admin-view role check in _is_admin_view_safe to break import cycle. - Require non-null row.user before treating spend log as owned by the key (fixes None==None bypass for service keys). - Document deferred proxy_server imports in _get_permitted_team_ids_for_spend_logs. - Update tests (common_utils patches, regression test, ruff cleanups). Made-with: Cursor
Non-admins previously skipped RBAC when prisma_client was None but could still read payloads from custom loggers. Return 403 unless admin view. Add test_ui_view_request_response_forbids_non_admin_without_db. Made-with: Cursor
…antd
Use Flex, Typography.Paragraph (with copyable), and Typography.Text
instead of raw divs + code block + CopyToClipboard wrapper. Drops the
direct react-copy-to-clipboard dependency in this component in favor
of antd's native copyable support.
Also fixes two test issues surfaced when running the e2e locally:
- RegenerateKeyModal.test.tsx no longer mocks react-copy-to-clipboard
(the component no longer imports it), removing the CJS require()
inside an ESM mock factory flagged by Greptile.
- keys.spec.ts scopes the Regenerate and Copy lookups to the modal.
The Regenerate button has an icon whose aria-label ("sync") is
concatenated into the button's accessible name, so an exact-match
lookup on "Regenerate" failed; and the new Paragraph copyable
renders a generic "Copy" button that collided with the other
copyable fields on the key info view.
feat(mcp): add per-user OAuth token storage for interactive MCP flows
fix(proxy): pass-through multipart uploads and Bedrock JSON body
…_2026 Litellm internal staging 04 11 2026
[Infra] Rebuild UI
bump: version 1.83.6 → 1.83.7
- Remove redundant useEffect cleanup that duplicated handleClose logic - Remove unnecessary currentAccessToken state, use accessToken from hook directly
…edis-post blog: restyle docs.litellm.ai/blog to engineering blog aesthetic
…ays, Conclusion CTA
…edis-post blog: Ramp-style engineering blog restyle + Redis circuit breaker post
Litellm dev 04 11 2026 p1
* blog: add back arrow to post pages * blog: style back arrow — fixed top-left below navbar
[Refactor] UI - Virtual Keys: migrate regenerate key modal to AntD
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
|
Too many files changed for review. ( |
fa605d8
into
litellm_oss_staging_04_08_2026
| # ) | ||
| # response.stream_to_file("output_speech.mp3") | ||
| `;break;default:t="\n# Code generation for this endpoint is not implemented yet."}return`${O} | ||
| ${t}`}],190272)},84899,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"},a=e.i(9583),n=o.forwardRef(function(e,n){return o.createElement(a.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["SendOutlined",0,n],84899)},518617,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"};var a=e.i(9583),n=o.forwardRef(function(e,n){return o.createElement(a.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["CloseCircleOutlined",0,n],518617)},245704,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"};var a=e.i(9583),n=o.forwardRef(function(e,n){return o.createElement(a.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["CheckCircleOutlined",0,n],245704)},245094,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"};var a=e.i(9583),n=o.forwardRef(function(e,n){return o.createElement(a.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["CodeOutlined",0,n],245094)},891547,e=>{"use strict";var t=e.i(843476),o=e.i(271645),i=e.i(199133),a=e.i(764205);e.s(["default",0,({onChange:e,value:n,className:r,accessToken:s,disabled:l})=>{let[c,d]=(0,o.useState)([]),[p,m]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{(async()=>{if(s){m(!0);try{let e=await (0,a.getGuardrailsList)(s);console.log("Guardrails response:",e),e.guardrails&&(console.log("Guardrails data:",e.guardrails),d(e.guardrails))}catch(e){console.error("Error fetching guardrails:",e)}finally{m(!1)}}})()},[s]),(0,t.jsx)("div",{children:(0,t.jsx)(i.Select,{mode:"multiple",disabled:l,placeholder:l?"Setting guardrails is a premium feature.":"Select guardrails",onChange:t=>{console.log("Selected guardrails:",t),e(t)},value:n,loading:p,className:r,allowClear:!0,options:c.map(e=>(console.log("Mapping guardrail:",e),{label:`${e.guardrail_name}`,value:e.guardrail_name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})}])},921511,e=>{"use strict";var t=e.i(843476),o=e.i(271645),i=e.i(199133),a=e.i(764205);function n(e){return e.filter(e=>(e.version_status??"draft")!=="draft").map(e=>{var t;let o=e.version_number??1,i=e.version_status??"draft";return{label:`${e.policy_name} — v${o} (${i})${e.description?` — ${e.description}`:""}`,value:"production"===i?e.policy_name:e.policy_id?(t=e.policy_id,`policy_${t}`):e.policy_name}})}e.s(["default",0,({onChange:e,value:r,className:s,accessToken:l,disabled:c,onPoliciesLoaded:d})=>{let[p,m]=(0,o.useState)([]),[u,f]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{(async()=>{if(l){f(!0);try{let e=await (0,a.getPoliciesList)(l);e.policies&&(m(e.policies),d?.(e.policies))}catch(e){console.error("Error fetching policies:",e)}finally{f(!1)}}})()},[l,d]),(0,t.jsx)("div",{children:(0,t.jsx)(i.Select,{mode:"multiple",disabled:c,placeholder:c?"Setting policies is a premium feature.":"Select policies (production or published versions)",onChange:t=>{e(t)},value:r,loading:u,className:s,allowClear:!0,options:n(p),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})},"getPolicyOptionEntries",()=>n])},689020,e=>{"use strict";var t=e.i(764205);let o=async e=>{try{let o=await (0,t.modelHubCall)(e);if(console.log("model_info:",o),o?.data.length>0){let e=o.data.map(e=>({model_group:e.model_group,mode:e?.mode}));return e.sort((e,t)=>e.model_group.localeCompare(t.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}};e.s(["fetchAvailableModels",0,o])},737434,e=>{"use strict";var t=e.i(184163);e.s(["DownloadOutlined",()=>t.default])},916940,e=>{"use strict";var t=e.i(843476),o=e.i(271645),i=e.i(199133),a=e.i(764205);e.s(["default",0,({onChange:e,value:n,className:r,accessToken:s,placeholder:l="Select vector stores",disabled:c=!1})=>{let[d,p]=(0,o.useState)([]),[m,u]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{(async()=>{if(s){u(!0);try{let e=await (0,a.vectorStoreListCall)(s);e.data&&p(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{u(!1)}}})()},[s]),(0,t.jsx)("div",{children:(0,t.jsx)(i.Select,{mode:"multiple",placeholder:l,onChange:e,value:n,loading:m,className:r,allowClear:!0,options:d.map(e=>({label:`${e.vector_store_name||e.vector_store_id} (${e.vector_store_id})`,value:e.vector_store_id,title:e.vector_store_description||e.vector_store_id})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:c})})}])},447566,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"};var a=e.i(9583),n=o.forwardRef(function(e,n){return o.createElement(a.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["ArrowLeftOutlined",0,n],447566)},637235,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"};var a=e.i(9583),n=o.forwardRef(function(e,n){return o.createElement(a.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["ClockCircleOutlined",0,n],637235)},782273,793916,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M625.9 115c-5.9 0-11.9 1.6-17.4 5.3L254 352H90c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h164l354.5 231.7c5.5 3.6 11.6 5.3 17.4 5.3 16.7 0 32.1-13.3 32.1-32.1V147.1c0-18.8-15.4-32.1-32.1-32.1zM586 803L293.4 611.7l-18-11.7H146V424h129.4l17.9-11.7L586 221v582zm348-327H806c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16h128c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16zm-41.9 261.8l-110.3-63.7a15.9 15.9 0 00-21.7 5.9l-19.9 34.5c-4.4 7.6-1.8 17.4 5.8 21.8L856.3 800a15.9 15.9 0 0021.7-5.9l19.9-34.5c4.4-7.6 1.7-17.4-5.8-21.8zM760 344a15.9 15.9 0 0021.7 5.9L892 286.2c7.6-4.4 10.2-14.2 5.8-21.8L878 230a15.9 15.9 0 00-21.7-5.9L746 287.8a15.99 15.99 0 00-5.8 21.8L760 344z"}}]},name:"sound",theme:"outlined"};var a=e.i(9583),n=o.forwardRef(function(e,n){return o.createElement(a.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["SoundOutlined",0,n],782273);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"}}]},name:"audio",theme:"outlined"};var s=o.forwardRef(function(e,i){return o.createElement(a.default,(0,t.default)({},e,{ref:i,icon:r}))});e.s(["AudioOutlined",0,s],793916)},149192,e=>{"use strict";var t=e.i(864517);e.s(["CloseOutlined",()=>t.default])},492030,e=>{"use strict";var t=e.i(121229);e.s(["CheckOutlined",()=>t.default])},458505,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm47.7-395.2l-25.4-5.9V348.6c38 5.2 61.5 29 65.5 58.2.5 4 3.9 6.9 7.9 6.9h44.9c4.7 0 8.4-4.1 8-8.8-6.1-62.3-57.4-102.3-125.9-109.2V263c0-4.4-3.6-8-8-8h-28.1c-4.4 0-8 3.6-8 8v33c-70.8 6.9-126.2 46-126.2 119 0 67.6 49.8 100.2 102.1 112.7l24.7 6.3v142.7c-44.2-5.9-69-29.5-74.1-61.3-.6-3.8-4-6.6-7.9-6.6H363c-4.7 0-8.4 4-8 8.7 4.5 55 46.2 105.6 135.2 112.1V761c0 4.4 3.6 8 8 8h28.4c4.4 0 8-3.6 8-8.1l-.2-31.7c78.3-6.9 134.3-48.8 134.3-124-.1-69.4-44.2-100.4-109-116.4zm-68.6-16.2c-5.6-1.6-10.3-3.1-15-5-33.8-12.2-49.5-31.9-49.5-57.3 0-36.3 27.5-57 64.5-61.7v124zM534.3 677V543.3c3.1.9 5.9 1.6 8.8 2.2 47.3 14.4 63.2 34.4 63.2 65.1 0 39.1-29.4 62.6-72 66.4z"}}]},name:"dollar",theme:"outlined"};var a=e.i(9583),n=o.forwardRef(function(e,n){return o.createElement(a.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["DollarOutlined",0,n],458505)},611052,e=>{"use strict";var t=e.i(843476),o=e.i(271645),i=e.i(212931),a=e.i(311451),n=e.i(790848),r=e.i(888259),s=e.i(438957);e.i(247167);var l=e.i(931067);let c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 10-56 0z"}}]},name:"lock",theme:"outlined"};var d=e.i(9583),p=o.forwardRef(function(e,t){return o.createElement(d.default,(0,l.default)({},e,{ref:t,icon:c}))}),m=e.i(492030),u=e.i(266537),f=e.i(447566),g=e.i(149192),h=e.i(596239);e.s(["ByokCredentialModal",0,({server:e,open:l,onClose:c,onSuccess:d,accessToken:_})=>{let[b,x]=(0,o.useState)(1),[v,y]=(0,o.useState)(""),[j,w]=(0,o.useState)(!0),[S,k]=(0,o.useState)(!1),C=e.alias||e.server_name||"Service",N=C.charAt(0).toUpperCase(),O=()=>{x(1),y(""),w(!0),k(!1),c()},z=async()=>{if(!v.trim())return void r.default.error("Please enter your API key");k(!0);try{let t=await fetch(`/v1/mcp/server/${e.server_id}/user-credential`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${_}`},body:JSON.stringify({credential:v.trim(),save:j})});if(!t.ok){let e=await t.json();throw Error(e?.detail?.error||"Failed to save credential")}r.default.success(`Connected to ${C}`),d(e.server_id),O()}catch(e){r.default.error(e.message||"Failed to connect")}finally{k(!1)}};return(0,t.jsx)(i.Modal,{open:l,onCancel:O,footer:null,width:480,closeIcon:null,className:"byok-modal",children:(0,t.jsxs)("div",{className:"relative p-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[2===b?(0,t.jsxs)("button",{onClick:()=>x(1),className:"flex items-center gap-1 text-gray-500 hover:text-gray-800 text-sm",children:[(0,t.jsx)(f.ArrowLeftOutlined,{})," Back"]}):(0,t.jsx)("div",{}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("div",{className:`w-2 h-2 rounded-full ${1===b?"bg-blue-500":"bg-gray-300"}`}),(0,t.jsx)("div",{className:`w-2 h-2 rounded-full ${2===b?"bg-blue-500":"bg-gray-300"}`})]}),(0,t.jsx)("button",{onClick:O,className:"text-gray-400 hover:text-gray-600",children:(0,t.jsx)(g.CloseOutlined,{})})]}),1===b?(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"flex items-center justify-center gap-3 mb-6",children:[(0,t.jsx)("div",{className:"w-14 h-14 rounded-xl bg-gradient-to-br from-teal-400 to-cyan-600 flex items-center justify-center text-white font-bold text-xl shadow",children:"L"}),(0,t.jsx)(u.ArrowRightOutlined,{className:"text-gray-400 text-lg"}),(0,t.jsx)("div",{className:"w-14 h-14 rounded-xl bg-gradient-to-br from-blue-600 to-indigo-800 flex items-center justify-center text-white font-bold text-xl shadow",children:N})]}),(0,t.jsxs)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:["Connect ",C]}),(0,t.jsxs)("p",{className:"text-gray-500 mb-6",children:["LiteLLM needs access to ",C," to complete your request."]}),(0,t.jsx)("div",{className:"bg-gray-50 rounded-xl p-4 text-left mb-4",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-0.5",children:(0,t.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",className:"text-gray-500",children:[(0,t.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",stroke:"currentColor",strokeWidth:"2"}),(0,t.jsx)("path",{d:"M8 4v16M16 4v16",stroke:"currentColor",strokeWidth:"2"})]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-semibold text-gray-800 mb-1",children:"How it works"}),(0,t.jsxs)("p",{className:"text-gray-500 text-sm",children:["LiteLLM acts as a secure bridge. Your requests are routed through our MCP client directly to"," ",C,"'s API."]})]})]})}),e.byok_description&&e.byok_description.length>0&&(0,t.jsxs)("div",{className:"bg-gray-50 rounded-xl p-4 text-left mb-6",children:[(0,t.jsxs)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-widest mb-3 flex items-center gap-2",children:[(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",className:"text-green-500",children:[(0,t.jsx)("path",{d:"M12 2L12 22M2 12L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2"})]}),"Requested Access"]}),(0,t.jsx)("ul",{className:"space-y-2",children:e.byok_description.map((e,o)=>(0,t.jsxs)("li",{className:"flex items-center gap-2 text-sm text-gray-700",children:[(0,t.jsx)(m.CheckOutlined,{className:"text-green-500 flex-shrink-0"}),e]},o))})]}),(0,t.jsxs)("button",{onClick:()=>x(2),className:"w-full bg-gray-900 hover:bg-gray-700 text-white font-medium py-3 px-6 rounded-xl flex items-center justify-center gap-2 transition-colors",children:["Continue to Authentication ",(0,t.jsx)(u.ArrowRightOutlined,{})]}),(0,t.jsx)("button",{onClick:O,className:"mt-3 w-full text-gray-400 hover:text-gray-600 text-sm py-2",children:"Cancel"})]}):(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-blue-50 flex items-center justify-center mb-4",children:(0,t.jsx)(s.KeyOutlined,{className:"text-blue-400 text-xl"})}),(0,t.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Provide API Key"}),(0,t.jsxs)("p",{className:"text-gray-500 mb-6",children:["Enter your ",C," API key to authorize this connection."]}),(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("label",{className:"block text-sm font-semibold text-gray-800 mb-2",children:[C," API Key"]}),(0,t.jsx)(a.Input.Password,{placeholder:"Enter your API key",value:v,onChange:e=>y(e.target.value),size:"large",className:"rounded-lg"}),e.byok_api_key_help_url&&(0,t.jsxs)("a",{href:e.byok_api_key_help_url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-700 text-sm mt-2 flex items-center gap-1",children:["Where do I find my API key? ",(0,t.jsx)(h.LinkOutlined,{})]})]}),(0,t.jsxs)("div",{className:"bg-gray-50 rounded-xl p-4 flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",className:"text-gray-500",children:(0,t.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z",fill:"currentColor"})}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-800",children:"Save key for future use"})]}),(0,t.jsx)(n.Switch,{checked:j,onChange:w})]}),(0,t.jsxs)("div",{className:"bg-blue-50 rounded-xl p-4 flex items-start gap-3 mb-6",children:[(0,t.jsx)(p,{className:"text-blue-400 mt-0.5 flex-shrink-0"}),(0,t.jsx)("p",{className:"text-sm text-blue-700",children:"Your key is stored securely and transmitted over HTTPS. It is never shared with third parties."})]}),(0,t.jsxs)("button",{onClick:z,disabled:S,className:"w-full bg-blue-500 hover:bg-blue-600 disabled:opacity-60 text-white font-medium py-3 px-6 rounded-xl flex items-center justify-center gap-2 transition-colors",children:[(0,t.jsx)(p,{})," Connect & Authorize"]})]})]})})}],611052)},829672,836938,310730,e=>{"use strict";e.i(247167);var t=e.i(271645),o=e.i(343794),i=e.i(914949),a=e.i(404948);let n=e=>e?"function"==typeof e?e():e:null;e.s(["getRenderPropValue",0,n],836938);var r=e.i(613541),s=e.i(763731),l=e.i(242064),c=e.i(491816);e.i(793154);var d=e.i(880476),p=e.i(183293),m=e.i(717356),u=e.i(320560),f=e.i(307358),g=e.i(246422),h=e.i(838378),_=e.i(617933);let b=(0,g.genStyleHooks)("Popover",e=>{let{colorBgElevated:t,colorText:o}=e,i=(0,h.mergeToken)(e,{popoverBg:t,popoverColor:o});return[(e=>{let{componentCls:t,popoverColor:o,titleMinWidth:i,fontWeightStrong:a,innerPadding:n,boxShadowSecondary:r,colorTextHeading:s,borderRadiusLG:l,zIndexPopup:c,titleMarginBottom:d,colorBgElevated:m,popoverBg:f,titleBorderBottom:g,innerContentPadding:h,titlePadding:_}=e;return[{[t]:Object.assign(Object.assign({},(0,p.resetComponent)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:c,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:"var(--valid-offset-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":m,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-inner`]:{backgroundColor:f,backgroundClip:"padding-box",borderRadius:l,boxShadow:r,padding:n},[`${t}-title`]:{minWidth:i,marginBottom:d,color:s,fontWeight:a,borderBottom:g,padding:_},[`${t}-inner-content`]:{color:o,padding:h}})},(0,u.default)(e,"var(--antd-arrow-background-color)"),{[`${t}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",[`${t}-content`]:{display:"inline-block"}}}]})(i),(e=>{let{componentCls:t}=e;return{[t]:_.PresetColors.map(o=>{let i=e[`${o}6`];return{[`&${t}-${o}`]:{"--antd-arrow-background-color":i,[`${t}-inner`]:{backgroundColor:i},[`${t}-arrow`]:{background:"transparent"}}}})}})(i),(0,m.initZoomMotion)(i,"zoom-big")]},e=>{let{lineWidth:t,controlHeight:o,fontHeight:i,padding:a,wireframe:n,zIndexPopupBase:r,borderRadiusLG:s,marginXS:l,lineType:c,colorSplit:d,paddingSM:p}=e,m=o-i;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:r+30},(0,f.getArrowToken)(e)),(0,u.getArrowOffsetToken)({contentRadius:s,limitVerticalRadius:!0})),{innerPadding:12*!n,titleMarginBottom:n?0:l,titlePadding:n?`${m/2}px ${a}px ${m/2-t}px`:0,titleBorderBottom:n?`${t}px ${c} ${d}`:"none",innerContentPadding:n?`${p}px ${a}px`:0})},{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]});var x=function(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,i=Object.getOwnPropertySymbols(e);a<i.length;a++)0>t.indexOf(i[a])&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(o[i[a]]=e[i[a]]);return o};let v=({title:e,content:o,prefixCls:i})=>e||o?t.createElement(t.Fragment,null,e&&t.createElement("div",{className:`${i}-title`},e),o&&t.createElement("div",{className:`${i}-inner-content`},o)):null,y=e=>{let{hashId:i,prefixCls:a,className:r,style:s,placement:l="top",title:c,content:p,children:m}=e,u=n(c),f=n(p),g=(0,o.default)(i,a,`${a}-pure`,`${a}-placement-${l}`,r);return t.createElement("div",{className:g,style:s},t.createElement("div",{className:`${a}-arrow`}),t.createElement(d.Popup,Object.assign({},e,{className:i,prefixCls:a}),m||t.createElement(v,{prefixCls:a,title:u,content:f})))},j=e=>{let{prefixCls:i,className:a}=e,n=x(e,["prefixCls","className"]),{getPrefixCls:r}=t.useContext(l.ConfigContext),s=r("popover",i),[c,d,p]=b(s);return c(t.createElement(y,Object.assign({},n,{prefixCls:s,hashId:d,className:(0,o.default)(a,p)})))};e.s(["Overlay",0,v,"default",0,j],310730);var w=function(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,i=Object.getOwnPropertySymbols(e);a<i.length;a++)0>t.indexOf(i[a])&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(o[i[a]]=e[i[a]]);return o};let S=t.forwardRef((e,d)=>{var p,m;let{prefixCls:u,title:f,content:g,overlayClassName:h,placement:_="top",trigger:x="hover",children:y,mouseEnterDelay:j=.1,mouseLeaveDelay:S=.1,onOpenChange:k,overlayStyle:C={},styles:N,classNames:O}=e,z=w(e,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle","styles","classNames"]),{getPrefixCls:E,className:I,style:R,classNames:T,styles:M}=(0,l.useComponentConfig)("popover"),A=E("popover",u),[$,P,L]=b(A),H=E(),F=(0,o.default)(h,P,L,I,T.root,null==O?void 0:O.root),B=(0,o.default)(T.body,null==O?void 0:O.body),[D,V]=(0,i.default)(!1,{value:null!=(p=e.open)?p:e.visible,defaultValue:null!=(m=e.defaultOpen)?m:e.defaultVisible}),q=(e,t)=>{V(e,!0),null==k||k(e,t)},U=n(f),W=n(g);return $(t.createElement(c.default,Object.assign({placement:_,trigger:x,mouseEnterDelay:j,mouseLeaveDelay:S},z,{prefixCls:A,classNames:{root:F,body:B},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},M.root),R),C),null==N?void 0:N.root),body:Object.assign(Object.assign({},M.body),null==N?void 0:N.body)},ref:d,open:D,onOpenChange:e=>{q(e)},overlay:U||W?t.createElement(v,{prefixCls:A,title:U,content:W}):null,transitionName:(0,r.getTransitionName)(H,"zoom-big",z.transitionName),"data-popover-inject":!0}),(0,s.cloneElement)(y,{onKeyDown:e=>{var o,i;(0,t.isValidElement)(y)&&(null==(i=null==y?void 0:(o=y.props).onKeyDown)||i.call(o,e)),e.keyCode===a.default.ESC&&q(!1,e)}})))});S._InternalPanelDoNotUseOrYouWillBeFired=j,e.s(["default",0,S],829672)},282786,e=>{"use strict";var t=e.i(829672);e.s(["Popover",()=>t.default])},219470,812618,e=>{"use strict";e.s(["coy",0,{'code[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",maxHeight:"inherit",height:"inherit",padding:"0 1em",display:"block",overflow:"auto"},'pre[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",position:"relative",margin:".5em 0",overflow:"visible",padding:"1px",backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em"},'pre[class*="language-"] > code':{position:"relative",zIndex:"1",borderLeft:"10px solid #358ccb",boxShadow:"-1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf",backgroundColor:"#fdfdfd",backgroundImage:"linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%)",backgroundSize:"3em 3em",backgroundOrigin:"content-box",backgroundAttachment:"local"},':not(pre) > code[class*="language-"]':{backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em",position:"relative",padding:".2em",borderRadius:"0.3em",color:"#c92c2c",border:"1px solid rgba(0, 0, 0, 0.1)",display:"inline",whiteSpace:"normal"},'pre[class*="language-"]:before':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"0.18em",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(-2deg)",MozTransform:"rotate(-2deg)",msTransform:"rotate(-2deg)",OTransform:"rotate(-2deg)",transform:"rotate(-2deg)"},'pre[class*="language-"]:after':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"auto",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(2deg)",MozTransform:"rotate(2deg)",msTransform:"rotate(2deg)",OTransform:"rotate(2deg)",transform:"rotate(2deg)",right:"0.75em"},comment:{color:"#7D8B99"},"block-comment":{color:"#7D8B99"},prolog:{color:"#7D8B99"},doctype:{color:"#7D8B99"},cdata:{color:"#7D8B99"},punctuation:{color:"#5F6364"},property:{color:"#c92c2c"},tag:{color:"#c92c2c"},boolean:{color:"#c92c2c"},number:{color:"#c92c2c"},"function-name":{color:"#c92c2c"},constant:{color:"#c92c2c"},symbol:{color:"#c92c2c"},deleted:{color:"#c92c2c"},selector:{color:"#2f9c0a"},"attr-name":{color:"#2f9c0a"},string:{color:"#2f9c0a"},char:{color:"#2f9c0a"},function:{color:"#2f9c0a"},builtin:{color:"#2f9c0a"},inserted:{color:"#2f9c0a"},operator:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},entity:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)",cursor:"help"},url:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},variable:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},atrule:{color:"#1990b8"},"attr-value":{color:"#1990b8"},keyword:{color:"#1990b8"},"class-name":{color:"#1990b8"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"normal"},".language-css .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},".style .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:".7"},'pre[class*="language-"].line-numbers.line-numbers':{paddingLeft:"0"},'pre[class*="language-"].line-numbers.line-numbers code':{paddingLeft:"3.8em"},'pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows':{left:"0"},'pre[class*="language-"][data-line]':{paddingTop:"0",paddingBottom:"0",paddingLeft:"0"},"pre[data-line] code":{position:"relative",paddingLeft:"4em"},"pre .line-highlight":{marginTop:"0"}}],219470),e.i(247167);var t=e.i(931067),o=e.i(271645);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"};var a=e.i(9583),n=o.forwardRef(function(e,n){return o.createElement(a.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["BulbOutlined",0,n],812618)},132104,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 545.5L536.1 163a31.96 31.96 0 00-48.3 0L156 545.5a7.97 7.97 0 006 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2z"}}]},name:"arrow-up",theme:"outlined"};var a=e.i(9583),n=o.forwardRef(function(e,n){return o.createElement(a.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["ArrowUpOutlined",0,n],132104)},447593,989022,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},a=e.i(9583),n=o.forwardRef(function(e,n){return o.createElement(a.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["ClearOutlined",0,n],447593);var r=e.i(843476),s=e.i(592968),l=e.i(637235);let c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 394c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H400V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v236H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h228v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h164c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V394h164zM628 630H400V394h228v236z"}}]},name:"number",theme:"outlined"};var d=o.forwardRef(function(e,i){return o.createElement(a.default,(0,t.default)({},e,{ref:i,icon:c}))});let p={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"};var m=o.forwardRef(function(e,i){return o.createElement(a.default,(0,t.default)({},e,{ref:i,icon:p}))}),u=e.i(872934),f=e.i(812618),g=e.i(366308),h=e.i(458505);e.s(["default",0,({timeToFirstToken:e,totalLatency:t,usage:o,toolName:i})=>e||t||o?(0,r.jsxs)("div",{className:"response-metrics mt-2 pt-2 border-t border-gray-100 text-xs text-gray-500 flex flex-wrap gap-3",children:[void 0!==e&&(0,r.jsx)(s.Tooltip,{title:"Time to first token",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(l.ClockCircleOutlined,{className:"mr-1"}),(0,r.jsxs)("span",{children:["TTFT: ",(e/1e3).toFixed(2),"s"]})]})}),void 0!==t&&(0,r.jsx)(s.Tooltip,{title:"Total latency",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(l.ClockCircleOutlined,{className:"mr-1"}),(0,r.jsxs)("span",{children:["Total Latency: ",(t/1e3).toFixed(2),"s"]})]})}),o?.promptTokens!==void 0&&(0,r.jsx)(s.Tooltip,{title:"Prompt tokens",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(m,{className:"mr-1"}),(0,r.jsxs)("span",{children:["In: ",o.promptTokens]})]})}),o?.completionTokens!==void 0&&(0,r.jsx)(s.Tooltip,{title:"Completion tokens",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(u.ExportOutlined,{className:"mr-1"}),(0,r.jsxs)("span",{children:["Out: ",o.completionTokens]})]})}),o?.reasoningTokens!==void 0&&(0,r.jsx)(s.Tooltip,{title:"Reasoning tokens",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(f.BulbOutlined,{className:"mr-1"}),(0,r.jsxs)("span",{children:["Reasoning: ",o.reasoningTokens]})]})}),o?.totalTokens!==void 0&&(0,r.jsx)(s.Tooltip,{title:"Total tokens",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(d,{className:"mr-1"}),(0,r.jsxs)("span",{children:["Total: ",o.totalTokens]})]})}),o?.cost!==void 0&&(0,r.jsx)(s.Tooltip,{title:"Cost",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(h.DollarOutlined,{className:"mr-1"}),(0,r.jsxs)("span",{children:["$",o.cost.toFixed(6)]})]})}),i&&(0,r.jsx)(s.Tooltip,{title:"Tool used",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(g.ToolOutlined,{className:"mr-1"}),(0,r.jsxs)("span",{children:["Tool: ",i]})]})})]}):null],989022)},434166,e=>{"use strict";function t(e,t){window.sessionStorage.setItem(e,btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))))}function o(e){try{let t=window.sessionStorage.getItem(e);if(null===t)return null;return decodeURIComponent(atob(t).split("").map(e=>"%"+e.charCodeAt(0).toString(16).padStart(2,"0")).join(""))}catch{return null}}e.s(["getSecureItem",()=>o,"setSecureItem",()=>t])},596239,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"};var a=e.i(9583),n=o.forwardRef(function(e,n){return o.createElement(a.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["LinkOutlined",0,n],596239)},166406,e=>{"use strict";var t=e.i(190144);e.s(["CopyOutlined",()=>t.default])},240647,e=>{"use strict";var t=e.i(286612);e.s(["RightOutlined",()=>t.default])},362024,e=>{"use strict";var t=e.i(988122);e.s(["Collapse",()=>t.default])},516015,(e,t,o)=>{},898547,(e,t,o)=>{var i=e.i(247167);e.r(516015);var a=e.r(271645),n=a&&"object"==typeof a&&"default"in a?a:{default:a},r=void 0!==i.default&&i.default.env&&!0,s=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,o=t.name,i=void 0===o?"stylesheet":o,a=t.optimizeForSpeed,n=void 0===a?r:a;c(s(i),"`name` must be a string"),this._name=i,this._deletedRulePlaceholder="#"+i+"-deleted-rule____{}",c("boolean"==typeof n,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=n,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var l="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=l?l.getAttribute("content"):null}var t,o=e.prototype;return o.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},o.isOptimizeForSpeed=function(){return this._optimizeForSpeed},o.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(r||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,o){return"number"==typeof o?e._serverSheet.cssRules[o]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),o},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},o.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},o.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},o.insertRule=function(e,t){if(c(s(e),"`insertRule` accepts only strings"),"u"<typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var o=this.getSheet();"number"!=typeof t&&(t=o.cssRules.length);try{o.insertRule(e,t)}catch(t){return r||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var i=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,i))}return this._rulesCount++},o.replaceRule=function(e,t){if(this._optimizeForSpeed||"u"<typeof window){var o="u">typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!o.cssRules[e])return e;o.deleteRule(e);try{o.insertRule(t,e)}catch(i){r||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),o.insertRule(this._deletedRulePlaceholder,e)}}else{var i=this._tags[e];c(i,"old rule at index `"+e+"` not found"),i.textContent=t}return e},o.deleteRule=function(e){if("u"<typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},o.flush=function(){this._injected=!1,this._rulesCount=0,"u">typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},o.cssRules=function(){var e=this;return"u"<typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,o){return o?t=t.concat(Array.prototype.map.call(e.getSheetForTag(o).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},o.makeStyleTag=function(e,t,o){t&&c(s(t),"makeStyleTag accepts only strings as second parameter");var i=document.createElement("style");this._nonce&&i.setAttribute("nonce",this._nonce),i.type="text/css",i.setAttribute("data-"+e,""),t&&i.appendChild(document.createTextNode(t));var a=document.head||document.getElementsByTagName("head")[0];return o?a.insertBefore(i,o):a.appendChild(i),i},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var o=0;o<t.length;o++){var i=t[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var d=function(e){for(var t=5381,o=e.length;o;)t=33*t^e.charCodeAt(--o);return t>>>0},p={};function m(e,t){if(!t)return"jsx-"+e;var o=String(t),i=e+o;return p[i]||(p[i]="jsx-"+d(e+"-"+o)),p[i]}function u(e,t){"u"<typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var o=e+t;return p[o]||(p[o]=t.replace(/__jsx-style-dynamic-selector/g,e)),p[o]}var f=function(){function e(e){var t=void 0===e?{}:e,o=t.styleSheet,i=void 0===o?null:o,a=t.optimizeForSpeed,n=void 0!==a&&a;this._sheet=i||new l({name:"styled-jsx",optimizeForSpeed:n}),this._sheet.inject(),i&&"boolean"==typeof n&&(this._sheet.setOptimizeForSpeed(n),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"u">typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var o=this.getIdAndRules(e),i=o.styleId,a=o.rules;if(i in this._instancesCounts){this._instancesCounts[i]+=1;return}var n=a.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[i]=n,this._instancesCounts[i]=1},t.remove=function(e){var t=this,o=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(o in this._instancesCounts,"styleId: `"+o+"` not found"),this._instancesCounts[o]-=1,this._instancesCounts[o]<1){var i=this._fromServer&&this._fromServer[o];i?(i.parentNode.removeChild(i),delete this._fromServer[o]):(this._indices[o].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[o]),delete this._instancesCounts[o]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],o=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return o[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,o;return t=this.cssRules(),void 0===(o=e)&&(o={}),t.map(function(e){var t=e[0],i=e[1];return n.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:o.nonce?o.nonce:void 0,dangerouslySetInnerHTML:{__html:i}})})},t.getIdAndRules=function(e){var t=e.children,o=e.dynamic,i=e.id;if(o){var a=m(i,o);return{styleId:a,rules:Array.isArray(t)?t.map(function(e){return u(a,e)}):[u(a,t)]}}return{styleId:m(i),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),g=a.createContext(null);function h(){return new f}function _(){return a.useContext(g)}g.displayName="StyleSheetContext";var b=n.default.useInsertionEffect||n.default.useLayoutEffect,x="u">typeof window?h():void 0;function v(e){var t=x||_();return t&&("u"<typeof window?t.add(e):b(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}v.dynamic=function(e){return e.map(function(e){return m(e[0],e[1])}).join(" ")},o.StyleRegistry=function(e){var t=e.registry,o=e.children,i=a.useContext(g),r=a.useState(function(){return i||t||h()})[0];return n.default.createElement(g.Provider,{value:r},o)},o.createStyleRegistry=h,o.style=v,o.useStyleRegistry=_},437902,(e,t,o)=>{t.exports=e.r(898547).style},254530,452598,e=>{"use strict";e.i(247167);var t=e.i(356449),o=e.i(764205);async function i(e,i,a,n,r,s,l,c,d,p,m,u,f,g,h,_,b,x,v,y,j,w,S,k,C){console.log=function(){},console.log("isLocal:",!1);let N=y||(0,o.getProxyBaseUrl)(),O={};r&&r.length>0&&(O["x-litellm-tags"]=r.join(","));let z=new t.default.OpenAI({apiKey:n,baseURL:N,dangerouslyAllowBrowser:!0,defaultHeaders:O});try{let t,o=Date.now(),n=!1,r={},y=!1,N=[];for await(let v of(g&&g.length>0&&(g.includes("__all__")?N.push({type:"mcp",server_label:"litellm",server_url:"litellm_proxy/mcp",require_approval:"never"}):g.forEach(e=>{if(e.startsWith("toolset:")){let t=e.slice(8),o=C?.find(e=>e.toolset_id===t),i=o?.toolset_name||t;N.push({type:"mcp",server_label:i,server_url:`litellm_proxy/mcp/${encodeURIComponent(i)}`,require_approval:"never"})}else{let t=j?.find(t=>t.server_id===e),o=t?.alias||t?.server_name||e,i=w?.[e]||[];N.push({type:"mcp",server_label:"litellm",server_url:`litellm_proxy/mcp/${o}`,require_approval:"never",...i.length>0?{allowed_tools:i}:{}})}})),await z.chat.completions.create({model:a,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:p,messages:e,...m?{vector_store_ids:m}:{},...u?{guardrails:u}:{},...f?{policies:f}:{},...N.length>0?{tools:N,tool_choice:"auto"}:{},...void 0!==b?{temperature:b}:{},...void 0!==x?{max_tokens:x}:{},...k?{mock_testing_fallbacks:!0}:{}},{signal:s}))){console.log("Stream chunk:",v);let e=v.choices[0]?.delta;if(console.log("Delta content:",v.choices[0]?.delta?.content),console.log("Delta reasoning content:",e?.reasoning_content),!n&&(v.choices[0]?.delta?.content||e&&e.reasoning_content)&&(n=!0,t=Date.now()-o,console.log("First token received! Time:",t,"ms"),c?(console.log("Calling onTimingData with:",t),c(t)):console.log("onTimingData callback is not defined!")),v.choices[0]?.delta?.content){let e=v.choices[0].delta.content;i(e,v.model)}if(e&&e.image&&h&&(console.log("Image generated:",e.image),h(e.image.url,v.model)),e&&e.reasoning_content){let t=e.reasoning_content;l&&l(t)}if(e&&e.provider_specific_fields?.search_results&&_&&(console.log("Search results found:",e.provider_specific_fields.search_results),_(e.provider_specific_fields.search_results)),e&&e.provider_specific_fields){let t=e.provider_specific_fields;if(t.mcp_list_tools&&!r.mcp_list_tools&&(r.mcp_list_tools=t.mcp_list_tools,S&&!y)){y=!0;let e={type:"response.output_item.done",item_id:"mcp_list_tools",item:{type:"mcp_list_tools",tools:t.mcp_list_tools.map(e=>({name:e.function?.name||e.name||"",description:e.function?.description||e.description||"",input_schema:e.function?.parameters||e.input_schema||{}}))},timestamp:Date.now()};S(e),console.log("MCP list_tools event sent:",e)}t.mcp_tool_calls&&(r.mcp_tool_calls=t.mcp_tool_calls),t.mcp_call_results&&(r.mcp_call_results=t.mcp_call_results),(t.mcp_list_tools||t.mcp_tool_calls||t.mcp_call_results)&&console.log("MCP metadata found in chunk:",{mcp_list_tools:t.mcp_list_tools?"present":"absent",mcp_tool_calls:t.mcp_tool_calls?"present":"absent",mcp_call_results:t.mcp_call_results?"present":"absent"})}if(v.usage&&d){console.log("Usage data found:",v.usage);let e={completionTokens:v.usage.completion_tokens,promptTokens:v.usage.prompt_tokens,totalTokens:v.usage.total_tokens};v.usage.completion_tokens_details?.reasoning_tokens&&(e.reasoningTokens=v.usage.completion_tokens_details.reasoning_tokens),void 0!==v.usage.cost&&null!==v.usage.cost&&(e.cost=parseFloat(v.usage.cost)),d(e)}}S&&(r.mcp_tool_calls||r.mcp_call_results)&&r.mcp_tool_calls&&r.mcp_tool_calls.length>0&&r.mcp_tool_calls.forEach((e,t)=>{let o=e.function?.name||e.name||"",i=e.function?.arguments||e.arguments||"{}",a=r.mcp_call_results?.find(t=>t.tool_call_id===e.id||t.tool_call_id===e.call_id)||r.mcp_call_results?.[t],n={type:"response.output_item.done",item:{type:"mcp_call",name:o,arguments:"string"==typeof i?i:JSON.stringify(i),output:a?.result?"string"==typeof a.result?a.result:JSON.stringify(a.result):void 0},item_id:e.id||e.call_id,timestamp:Date.now()};S(n),console.log("MCP call event sent:",n)});let O=Date.now();v&&v(O-o)}catch(e){throw s?.aborted&&console.log("Chat completion request was cancelled"),e}}e.s(["makeOpenAIChatCompletionRequest",()=>i],254530);var a=e.i(727749);async function n(e,i,r,s,l=[],c,d,p,m,u,f,g,h,_,b,x,v,y,j,w,S,k,C){if(!s)throw Error("Virtual Key is required");if(!r||""===r.trim())throw Error("Model is required. Please select a model before sending a request.");console.log=function(){};let N=w||(0,o.getProxyBaseUrl)(),O={};l&&l.length>0&&(O["x-litellm-tags"]=l.join(","));let z=new t.default.OpenAI({apiKey:s,baseURL:N,dangerouslyAllowBrowser:!0,defaultHeaders:O});try{let t=Date.now(),o=!1,a=e.map(e=>(Array.isArray(e.content),{role:e.role,content:e.content,type:"message"})),n=[];_&&_.length>0&&(_.includes("__all__")?n.push({type:"mcp",server_label:"litellm",server_url:`${N}/mcp`,require_approval:"never"}):_.forEach(e=>{if(e.startsWith("toolset:")){let t=e.slice(8),o=C?.find(e=>e.toolset_id===t),i=o?.toolset_name||t;n.push({type:"mcp",server_label:i,server_url:`${N}/mcp/${encodeURIComponent(i)}`,require_approval:"never"})}else{let t=S?.find(t=>t.server_id===e),o=t?.server_name||e,i=k?.[e]||[];n.push({type:"mcp",server_label:o,server_url:`${N}/mcp/${encodeURIComponent(o)}`,require_approval:"never",...i.length>0?{allowed_tools:i}:{}})}})),y&&n.push({type:"code_interpreter",container:{type:"auto"}});let s=await z.responses.create({model:r,input:a,stream:!0,litellm_trace_id:u,...b?{previous_response_id:b}:{},...f?{vector_store_ids:f}:{},...g?{guardrails:g}:{},...h?{policies:h}:{},...n.length>0?{tools:n,tool_choice:"auto"}:{}},{signal:c}),l="",w={code:"",containerId:""};for await(let e of s)if(console.log("Response event:",e),"object"==typeof e&&null!==e){if((e.type?.startsWith("response.mcp_")||"response.output_item.done"===e.type&&(e.item?.type==="mcp_list_tools"||e.item?.type==="mcp_call"))&&(console.log("MCP event received:",e),v)){let t={type:e.type,sequence_number:e.sequence_number,output_index:e.output_index,item_id:e.item_id||e.item?.id,item:e.item,delta:e.delta,arguments:e.arguments,timestamp:Date.now()};v(t)}"response.output_item.done"===e.type&&e.item?.type==="mcp_call"&&e.item?.name&&(l=e.item.name,console.log("MCP tool used:",l)),E=w;var E,I=w="response.output_item.done"===e.type&&e.item?.type==="code_interpreter_call"?(console.log("Code interpreter call completed:",e.item),{code:e.item.code||"",containerId:e.item.container_id||""}):E;if("response.output_item.done"===e.type&&e.item?.type==="message"&&e.item?.content&&j){for(let t of e.item.content)if("output_text"===t.type&&t.annotations){let e=t.annotations.filter(e=>"container_file_citation"===e.type);(e.length>0||I.code)&&j({code:I.code,containerId:I.containerId,annotations:e})}}if("response.role.delta"===e.type)continue;if("response.output_text.delta"===e.type&&"string"==typeof e.delta){let a=e.delta;if(console.log("Text delta",a),a.length>0&&(i("assistant",a,r),!o)){o=!0;let e=Date.now()-t;console.log("First token received! Time:",e,"ms"),p&&p(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let t=e.delta;"string"==typeof t&&d&&d(t)}if("response.completed"===e.type&&"response"in e){let t=e.response,o=t.usage;if(console.log("Usage data:",o),console.log("Response completed event:",t),t.id&&x&&(console.log("Response ID for session management:",t.id),x(t.id)),o&&m){console.log("Usage data:",o);let e={completionTokens:o.output_tokens,promptTokens:o.input_tokens,totalTokens:o.total_tokens};o.completion_tokens_details?.reasoning_tokens&&(e.reasoningTokens=o.completion_tokens_details.reasoning_tokens),m(e,l)}}}return s}catch(e){throw c?.aborted?console.log("Responses API request was cancelled"):a.default.fromBackend(`Error occurred while generating model response. Please try again. Error: ${e}`),e}}e.s(["makeOpenAIResponsesRequest",()=>n],452598)},355343,e=>{"use strict";var t=e.i(843476),o=e.i(437902),i=e.i(898586),a=e.i(362024);let{Text:n}=i.Typography,{Panel:r}=a.Collapse;e.s(["default",0,({events:e,className:i})=>{if(console.log("MCPEventsDisplay: Received events:",e),!e||0===e.length)return console.log("MCPEventsDisplay: No events, returning null"),null;let n=e.find(e=>"response.output_item.done"===e.type&&e.item?.type==="mcp_list_tools"&&e.item.tools&&e.item.tools.length>0),s=e.filter(e=>"response.output_item.done"===e.type&&e.item?.type==="mcp_call");return(console.log("MCPEventsDisplay: toolsEvent:",n),console.log("MCPEventsDisplay: mcpCallEvents:",s),n||0!==s.length)?(0,t.jsxs)("div",{className:`jsx-32b14b04f420f3ac mcp-events-display ${i||""}`,children:[(0,t.jsx)(o.default,{id:"32b14b04f420f3ac",children:".openai-mcp-tools.jsx-32b14b04f420f3ac{margin:0;padding:0;position:relative}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse.jsx-32b14b04f420f3ac,.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-item.jsx-32b14b04f420f3ac{background:0 0!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac{color:#9ca3af!important;background:0 0!important;border:none!important;min-height:20px!important;padding:0 0 0 20px!important;font-size:14px!important;font-weight:400!important;line-height:20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac:hover{color:#6b7280!important;background:0 0!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content.jsx-32b14b04f420f3ac{background:0 0!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content-box.jsx-32b14b04f420f3ac{padding:4px 0 0 20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac{color:#9ca3af!important;justify-content:center!important;align-items:center!important;width:16px!important;height:16px!important;font-size:10px!important;display:flex!important;position:absolute!important;top:2px!important;left:2px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac:hover{color:#6b7280!important}.openai-vertical-line.jsx-32b14b04f420f3ac{opacity:.8;background-color:#f3f4f6;width:.5px;position:absolute;top:18px;bottom:0;left:9px}.tool-item.jsx-32b14b04f420f3ac{color:#4b5563;z-index:1;background:#fff;margin:0;padding:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:18px;position:relative}.mcp-section.jsx-32b14b04f420f3ac{z-index:1;background:#fff;margin-bottom:12px;position:relative}.mcp-section.jsx-32b14b04f420f3ac:last-child{margin-bottom:0}.mcp-section-header.jsx-32b14b04f420f3ac{color:#6b7280;margin-bottom:4px;font-size:13px;font-weight:500}.mcp-code-block.jsx-32b14b04f420f3ac{background:#f9fafb;border:1px solid #f3f4f6;border-radius:6px;padding:8px;font-size:12px}.mcp-json.jsx-32b14b04f420f3ac{color:#374151;white-space:pre-wrap;word-wrap:break-word;margin:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace}.mcp-approved.jsx-32b14b04f420f3ac{color:#6b7280;align-items:center;font-size:13px;display:flex}.mcp-checkmark.jsx-32b14b04f420f3ac{color:#10b981;margin-right:6px;font-weight:700}.mcp-response-content.jsx-32b14b04f420f3ac{color:#374151;white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.5}"}),(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac openai-mcp-tools",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac openai-vertical-line"}),(0,t.jsxs)(a.Collapse,{ghost:!0,size:"small",expandIconPosition:"start",defaultActiveKey:n?["list-tools"]:s.map((e,t)=>`mcp-call-${t}`),children:[n&&(0,t.jsx)(r,{header:"List tools",children:(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac",children:n.item?.tools?.map((e,o)=>(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac tool-item",children:e.name},o))})},"list-tools"),s.map((e,o)=>(0,t.jsx)(r,{header:e.item?.name||"Tool call",children:(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac",children:[(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Request"}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-code-block",children:e.item?.arguments&&(0,t.jsx)("pre",{className:"jsx-32b14b04f420f3ac mcp-json",children:(()=>{try{return JSON.stringify(JSON.parse(e.item.arguments),null,2)}catch(t){return e.item.arguments}})()})})]}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-approved",children:[(0,t.jsx)("span",{className:"jsx-32b14b04f420f3ac mcp-checkmark",children:"✓"})," Approved"]})}),e.item?.output&&(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Response"}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-response-content",children:e.item.output})]})]})},`mcp-call-${o}`))]})]})]}):(console.log("MCPEventsDisplay: No valid events found, returning null"),null)}])},966988,e=>{"use strict";var t=e.i(843476),o=e.i(271645),i=e.i(464571),a=e.i(918789),n=e.i(650056),r=e.i(219470),s=e.i(755151),l=e.i(240647),c=e.i(812618);e.s(["default",0,({reasoningContent:e})=>{let[d,p]=(0,o.useState)(!0);return e?(0,t.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,t.jsxs)(i.Button,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>p(!d),icon:(0,t.jsx)(c.BulbOutlined,{}),children:[d?"Hide reasoning":"Show reasoning",d?(0,t.jsx)(s.DownOutlined,{className:"ml-1"}):(0,t.jsx)(l.RightOutlined,{className:"ml-1"})]}),d&&(0,t.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,t.jsx)(a.default,{components:{code({node:e,inline:o,className:i,children:a,...s}){let l=/language-(\w+)/.exec(i||"");return!o&&l?(0,t.jsx)(n.Prism,{style:r.coy,language:l[1],PreTag:"div",className:"rounded-md my-2",...s,children:String(a).replace(/\n$/,"")}):(0,t.jsx)("code",{className:`${i} px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono`,...s,children:a})}},children:e})})]}):null}])}]); No newline at end of file |
| @@ -0,0 +1,420 @@ | |||
| (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,434166,e=>{"use strict";function t(e,t){window.sessionStorage.setItem(e,btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))))}function o(e){try{let t=window.sessionStorage.getItem(e);if(null===t)return null;return decodeURIComponent(atob(t).split("").map(e=>"%"+e.charCodeAt(0).toString(16).padStart(2,"0")).join(""))}catch{return null}}e.s(["getSecureItem",()=>o,"setSecureItem",()=>t])},596239,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["LinkOutlined",0,a],596239)},166406,e=>{"use strict";var t=e.i(190144);e.s(["CopyOutlined",()=>t.default])},240647,e=>{"use strict";var t=e.i(286612);e.s(["RightOutlined",()=>t.default])},362024,e=>{"use strict";var t=e.i(988122);e.s(["Collapse",()=>t.default])},516015,(e,t,o)=>{},898547,(e,t,o)=>{var n=e.i(247167);e.r(516015);var i=e.r(271645),a=i&&"object"==typeof i&&"default"in i?i:{default:i},s=void 0!==n.default&&n.default.env&&!0,r=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,o=t.name,n=void 0===o?"stylesheet":o,i=t.optimizeForSpeed,a=void 0===i?s:i;c(r(n),"`name` must be a string"),this._name=n,this._deletedRulePlaceholder="#"+n+"-deleted-rule____{}",c("boolean"==typeof a,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=a,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var l="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=l?l.getAttribute("content"):null}var t,o=e.prototype;return o.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},o.isOptimizeForSpeed=function(){return this._optimizeForSpeed},o.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(s||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,o){return"number"==typeof o?e._serverSheet.cssRules[o]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),o},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},o.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},o.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},o.insertRule=function(e,t){if(c(r(e),"`insertRule` accepts only strings"),"u"<typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var o=this.getSheet();"number"!=typeof t&&(t=o.cssRules.length);try{o.insertRule(e,t)}catch(t){return s||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var n=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,n))}return this._rulesCount++},o.replaceRule=function(e,t){if(this._optimizeForSpeed||"u"<typeof window){var o="u">typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!o.cssRules[e])return e;o.deleteRule(e);try{o.insertRule(t,e)}catch(n){s||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),o.insertRule(this._deletedRulePlaceholder,e)}}else{var n=this._tags[e];c(n,"old rule at index `"+e+"` not found"),n.textContent=t}return e},o.deleteRule=function(e){if("u"<typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},o.flush=function(){this._injected=!1,this._rulesCount=0,"u">typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},o.cssRules=function(){var e=this;return"u"<typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,o){return o?t=t.concat(Array.prototype.map.call(e.getSheetForTag(o).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},o.makeStyleTag=function(e,t,o){t&&c(r(t),"makeStyleTag accepts only strings as second parameter");var n=document.createElement("style");this._nonce&&n.setAttribute("nonce",this._nonce),n.type="text/css",n.setAttribute("data-"+e,""),t&&n.appendChild(document.createTextNode(t));var i=document.head||document.getElementsByTagName("head")[0];return o?i.insertBefore(n,o):i.appendChild(n),n},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var p=function(e){for(var t=5381,o=e.length;o;)t=33*t^e.charCodeAt(--o);return t>>>0},d={};function m(e,t){if(!t)return"jsx-"+e;var o=String(t),n=e+o;return d[n]||(d[n]="jsx-"+p(e+"-"+o)),d[n]}function u(e,t){"u"<typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var o=e+t;return d[o]||(d[o]=t.replace(/__jsx-style-dynamic-selector/g,e)),d[o]}var f=function(){function e(e){var t=void 0===e?{}:e,o=t.styleSheet,n=void 0===o?null:o,i=t.optimizeForSpeed,a=void 0!==i&&i;this._sheet=n||new l({name:"styled-jsx",optimizeForSpeed:a}),this._sheet.inject(),n&&"boolean"==typeof a&&(this._sheet.setOptimizeForSpeed(a),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"u">typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var o=this.getIdAndRules(e),n=o.styleId,i=o.rules;if(n in this._instancesCounts){this._instancesCounts[n]+=1;return}var a=i.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[n]=a,this._instancesCounts[n]=1},t.remove=function(e){var t=this,o=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(o in this._instancesCounts,"styleId: `"+o+"` not found"),this._instancesCounts[o]-=1,this._instancesCounts[o]<1){var n=this._fromServer&&this._fromServer[o];n?(n.parentNode.removeChild(n),delete this._fromServer[o]):(this._indices[o].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[o]),delete this._instancesCounts[o]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],o=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return o[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,o;return t=this.cssRules(),void 0===(o=e)&&(o={}),t.map(function(e){var t=e[0],n=e[1];return a.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:o.nonce?o.nonce:void 0,dangerouslySetInnerHTML:{__html:n}})})},t.getIdAndRules=function(e){var t=e.children,o=e.dynamic,n=e.id;if(o){var i=m(n,o);return{styleId:i,rules:Array.isArray(t)?t.map(function(e){return u(i,e)}):[u(i,t)]}}return{styleId:m(n),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),g=i.createContext(null);function h(){return new f}function _(){return i.useContext(g)}g.displayName="StyleSheetContext";var b=a.default.useInsertionEffect||a.default.useLayoutEffect,v="u">typeof window?h():void 0;function x(e){var t=v||_();return t&&("u"<typeof window?t.add(e):b(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}x.dynamic=function(e){return e.map(function(e){return m(e[0],e[1])}).join(" ")},o.StyleRegistry=function(e){var t=e.registry,o=e.children,n=i.useContext(g),s=i.useState(function(){return n||t||h()})[0];return a.default.createElement(g.Provider,{value:s},o)},o.createStyleRegistry=h,o.style=x,o.useStyleRegistry=_},437902,(e,t,o)=>{t.exports=e.r(898547).style},254530,452598,e=>{"use strict";e.i(247167);var t=e.i(356449),o=e.i(764205);async function n(e,n,i,a,s,r,l,c,p,d,m,u,f,g,h,_,b,v,x,y,w,j,S,k,C){console.log=function(){},console.log("isLocal:",!1);let O=y||(0,o.getProxyBaseUrl)(),E={};s&&s.length>0&&(E["x-litellm-tags"]=s.join(","));let T=new t.default.OpenAI({apiKey:a,baseURL:O,dangerouslyAllowBrowser:!0,defaultHeaders:E});try{let t,o=Date.now(),a=!1,s={},y=!1,O=[];for await(let x of(g&&g.length>0&&(g.includes("__all__")?O.push({type:"mcp",server_label:"litellm",server_url:"litellm_proxy/mcp",require_approval:"never"}):g.forEach(e=>{if(e.startsWith("toolset:")){let t=e.slice(8),o=C?.find(e=>e.toolset_id===t),n=o?.toolset_name||t;O.push({type:"mcp",server_label:n,server_url:`litellm_proxy/mcp/${encodeURIComponent(n)}`,require_approval:"never"})}else{let t=w?.find(t=>t.server_id===e),o=t?.alias||t?.server_name||e,n=j?.[e]||[];O.push({type:"mcp",server_label:"litellm",server_url:`litellm_proxy/mcp/${o}`,require_approval:"never",...n.length>0?{allowed_tools:n}:{}})}})),await T.chat.completions.create({model:i,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:d,messages:e,...m?{vector_store_ids:m}:{},...u?{guardrails:u}:{},...f?{policies:f}:{},...O.length>0?{tools:O,tool_choice:"auto"}:{},...void 0!==b?{temperature:b}:{},...void 0!==v?{max_tokens:v}:{},...k?{mock_testing_fallbacks:!0}:{}},{signal:r}))){console.log("Stream chunk:",x);let e=x.choices[0]?.delta;if(console.log("Delta content:",x.choices[0]?.delta?.content),console.log("Delta reasoning content:",e?.reasoning_content),!a&&(x.choices[0]?.delta?.content||e&&e.reasoning_content)&&(a=!0,t=Date.now()-o,console.log("First token received! Time:",t,"ms"),c?(console.log("Calling onTimingData with:",t),c(t)):console.log("onTimingData callback is not defined!")),x.choices[0]?.delta?.content){let e=x.choices[0].delta.content;n(e,x.model)}if(e&&e.image&&h&&(console.log("Image generated:",e.image),h(e.image.url,x.model)),e&&e.reasoning_content){let t=e.reasoning_content;l&&l(t)}if(e&&e.provider_specific_fields?.search_results&&_&&(console.log("Search results found:",e.provider_specific_fields.search_results),_(e.provider_specific_fields.search_results)),e&&e.provider_specific_fields){let t=e.provider_specific_fields;if(t.mcp_list_tools&&!s.mcp_list_tools&&(s.mcp_list_tools=t.mcp_list_tools,S&&!y)){y=!0;let e={type:"response.output_item.done",item_id:"mcp_list_tools",item:{type:"mcp_list_tools",tools:t.mcp_list_tools.map(e=>({name:e.function?.name||e.name||"",description:e.function?.description||e.description||"",input_schema:e.function?.parameters||e.input_schema||{}}))},timestamp:Date.now()};S(e),console.log("MCP list_tools event sent:",e)}t.mcp_tool_calls&&(s.mcp_tool_calls=t.mcp_tool_calls),t.mcp_call_results&&(s.mcp_call_results=t.mcp_call_results),(t.mcp_list_tools||t.mcp_tool_calls||t.mcp_call_results)&&console.log("MCP metadata found in chunk:",{mcp_list_tools:t.mcp_list_tools?"present":"absent",mcp_tool_calls:t.mcp_tool_calls?"present":"absent",mcp_call_results:t.mcp_call_results?"present":"absent"})}if(x.usage&&p){console.log("Usage data found:",x.usage);let e={completionTokens:x.usage.completion_tokens,promptTokens:x.usage.prompt_tokens,totalTokens:x.usage.total_tokens};x.usage.completion_tokens_details?.reasoning_tokens&&(e.reasoningTokens=x.usage.completion_tokens_details.reasoning_tokens),void 0!==x.usage.cost&&null!==x.usage.cost&&(e.cost=parseFloat(x.usage.cost)),p(e)}}S&&(s.mcp_tool_calls||s.mcp_call_results)&&s.mcp_tool_calls&&s.mcp_tool_calls.length>0&&s.mcp_tool_calls.forEach((e,t)=>{let o=e.function?.name||e.name||"",n=e.function?.arguments||e.arguments||"{}",i=s.mcp_call_results?.find(t=>t.tool_call_id===e.id||t.tool_call_id===e.call_id)||s.mcp_call_results?.[t],a={type:"response.output_item.done",item:{type:"mcp_call",name:o,arguments:"string"==typeof n?n:JSON.stringify(n),output:i?.result?"string"==typeof i.result?i.result:JSON.stringify(i.result):void 0},item_id:e.id||e.call_id,timestamp:Date.now()};S(a),console.log("MCP call event sent:",a)});let E=Date.now();x&&x(E-o)}catch(e){throw r?.aborted&&console.log("Chat completion request was cancelled"),e}}e.s(["makeOpenAIChatCompletionRequest",()=>n],254530);var i=e.i(727749);async function a(e,n,s,r,l=[],c,p,d,m,u,f,g,h,_,b,v,x,y,w,j,S,k,C){if(!r)throw Error("Virtual Key is required");if(!s||""===s.trim())throw Error("Model is required. Please select a model before sending a request.");console.log=function(){};let O=j||(0,o.getProxyBaseUrl)(),E={};l&&l.length>0&&(E["x-litellm-tags"]=l.join(","));let T=new t.default.OpenAI({apiKey:r,baseURL:O,dangerouslyAllowBrowser:!0,defaultHeaders:E});try{let t=Date.now(),o=!1,i=e.map(e=>(Array.isArray(e.content),{role:e.role,content:e.content,type:"message"})),a=[];_&&_.length>0&&(_.includes("__all__")?a.push({type:"mcp",server_label:"litellm",server_url:`${O}/mcp`,require_approval:"never"}):_.forEach(e=>{if(e.startsWith("toolset:")){let t=e.slice(8),o=C?.find(e=>e.toolset_id===t),n=o?.toolset_name||t;a.push({type:"mcp",server_label:n,server_url:`${O}/mcp/${encodeURIComponent(n)}`,require_approval:"never"})}else{let t=S?.find(t=>t.server_id===e),o=t?.server_name||e,n=k?.[e]||[];a.push({type:"mcp",server_label:o,server_url:`${O}/mcp/${encodeURIComponent(o)}`,require_approval:"never",...n.length>0?{allowed_tools:n}:{}})}})),y&&a.push({type:"code_interpreter",container:{type:"auto"}});let r=await T.responses.create({model:s,input:i,stream:!0,litellm_trace_id:u,...b?{previous_response_id:b}:{},...f?{vector_store_ids:f}:{},...g?{guardrails:g}:{},...h?{policies:h}:{},...a.length>0?{tools:a,tool_choice:"auto"}:{}},{signal:c}),l="",j={code:"",containerId:""};for await(let e of r)if(console.log("Response event:",e),"object"==typeof e&&null!==e){if((e.type?.startsWith("response.mcp_")||"response.output_item.done"===e.type&&(e.item?.type==="mcp_list_tools"||e.item?.type==="mcp_call"))&&(console.log("MCP event received:",e),x)){let t={type:e.type,sequence_number:e.sequence_number,output_index:e.output_index,item_id:e.item_id||e.item?.id,item:e.item,delta:e.delta,arguments:e.arguments,timestamp:Date.now()};x(t)}"response.output_item.done"===e.type&&e.item?.type==="mcp_call"&&e.item?.name&&(l=e.item.name,console.log("MCP tool used:",l)),z=j;var z,R=j="response.output_item.done"===e.type&&e.item?.type==="code_interpreter_call"?(console.log("Code interpreter call completed:",e.item),{code:e.item.code||"",containerId:e.item.container_id||""}):z;if("response.output_item.done"===e.type&&e.item?.type==="message"&&e.item?.content&&w){for(let t of e.item.content)if("output_text"===t.type&&t.annotations){let e=t.annotations.filter(e=>"container_file_citation"===e.type);(e.length>0||R.code)&&w({code:R.code,containerId:R.containerId,annotations:e})}}if("response.role.delta"===e.type)continue;if("response.output_text.delta"===e.type&&"string"==typeof e.delta){let i=e.delta;if(console.log("Text delta",i),i.length>0&&(n("assistant",i,s),!o)){o=!0;let e=Date.now()-t;console.log("First token received! Time:",e,"ms"),d&&d(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let t=e.delta;"string"==typeof t&&p&&p(t)}if("response.completed"===e.type&&"response"in e){let t=e.response,o=t.usage;if(console.log("Usage data:",o),console.log("Response completed event:",t),t.id&&v&&(console.log("Response ID for session management:",t.id),v(t.id)),o&&m){console.log("Usage data:",o);let e={completionTokens:o.output_tokens,promptTokens:o.input_tokens,totalTokens:o.total_tokens};o.completion_tokens_details?.reasoning_tokens&&(e.reasoningTokens=o.completion_tokens_details.reasoning_tokens),m(e,l)}}}return r}catch(e){throw c?.aborted?console.log("Responses API request was cancelled"):i.default.fromBackend(`Error occurred while generating model response. Please try again. Error: ${e}`),e}}e.s(["makeOpenAIResponsesRequest",()=>a],452598)},355343,e=>{"use strict";var t=e.i(843476),o=e.i(437902),n=e.i(898586),i=e.i(362024);let{Text:a}=n.Typography,{Panel:s}=i.Collapse;e.s(["default",0,({events:e,className:n})=>{if(console.log("MCPEventsDisplay: Received events:",e),!e||0===e.length)return console.log("MCPEventsDisplay: No events, returning null"),null;let a=e.find(e=>"response.output_item.done"===e.type&&e.item?.type==="mcp_list_tools"&&e.item.tools&&e.item.tools.length>0),r=e.filter(e=>"response.output_item.done"===e.type&&e.item?.type==="mcp_call");return(console.log("MCPEventsDisplay: toolsEvent:",a),console.log("MCPEventsDisplay: mcpCallEvents:",r),a||0!==r.length)?(0,t.jsxs)("div",{className:`jsx-32b14b04f420f3ac mcp-events-display ${n||""}`,children:[(0,t.jsx)(o.default,{id:"32b14b04f420f3ac",children:".openai-mcp-tools.jsx-32b14b04f420f3ac{margin:0;padding:0;position:relative}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse.jsx-32b14b04f420f3ac,.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-item.jsx-32b14b04f420f3ac{background:0 0!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac{color:#9ca3af!important;background:0 0!important;border:none!important;min-height:20px!important;padding:0 0 0 20px!important;font-size:14px!important;font-weight:400!important;line-height:20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac:hover{color:#6b7280!important;background:0 0!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content.jsx-32b14b04f420f3ac{background:0 0!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content-box.jsx-32b14b04f420f3ac{padding:4px 0 0 20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac{color:#9ca3af!important;justify-content:center!important;align-items:center!important;width:16px!important;height:16px!important;font-size:10px!important;display:flex!important;position:absolute!important;top:2px!important;left:2px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac:hover{color:#6b7280!important}.openai-vertical-line.jsx-32b14b04f420f3ac{opacity:.8;background-color:#f3f4f6;width:.5px;position:absolute;top:18px;bottom:0;left:9px}.tool-item.jsx-32b14b04f420f3ac{color:#4b5563;z-index:1;background:#fff;margin:0;padding:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:18px;position:relative}.mcp-section.jsx-32b14b04f420f3ac{z-index:1;background:#fff;margin-bottom:12px;position:relative}.mcp-section.jsx-32b14b04f420f3ac:last-child{margin-bottom:0}.mcp-section-header.jsx-32b14b04f420f3ac{color:#6b7280;margin-bottom:4px;font-size:13px;font-weight:500}.mcp-code-block.jsx-32b14b04f420f3ac{background:#f9fafb;border:1px solid #f3f4f6;border-radius:6px;padding:8px;font-size:12px}.mcp-json.jsx-32b14b04f420f3ac{color:#374151;white-space:pre-wrap;word-wrap:break-word;margin:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace}.mcp-approved.jsx-32b14b04f420f3ac{color:#6b7280;align-items:center;font-size:13px;display:flex}.mcp-checkmark.jsx-32b14b04f420f3ac{color:#10b981;margin-right:6px;font-weight:700}.mcp-response-content.jsx-32b14b04f420f3ac{color:#374151;white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.5}"}),(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac openai-mcp-tools",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac openai-vertical-line"}),(0,t.jsxs)(i.Collapse,{ghost:!0,size:"small",expandIconPosition:"start",defaultActiveKey:a?["list-tools"]:r.map((e,t)=>`mcp-call-${t}`),children:[a&&(0,t.jsx)(s,{header:"List tools",children:(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac",children:a.item?.tools?.map((e,o)=>(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac tool-item",children:e.name},o))})},"list-tools"),r.map((e,o)=>(0,t.jsx)(s,{header:e.item?.name||"Tool call",children:(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac",children:[(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Request"}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-code-block",children:e.item?.arguments&&(0,t.jsx)("pre",{className:"jsx-32b14b04f420f3ac mcp-json",children:(()=>{try{return JSON.stringify(JSON.parse(e.item.arguments),null,2)}catch(t){return e.item.arguments}})()})})]}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-approved",children:[(0,t.jsx)("span",{className:"jsx-32b14b04f420f3ac mcp-checkmark",children:"✓"})," Approved"]})}),e.item?.output&&(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Response"}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-response-content",children:e.item.output})]})]})},`mcp-call-${o}`))]})]})]}):(console.log("MCPEventsDisplay: No valid events found, returning null"),null)}])},966988,e=>{"use strict";var t=e.i(843476),o=e.i(271645),n=e.i(464571),i=e.i(918789),a=e.i(650056),s=e.i(219470),r=e.i(755151),l=e.i(240647),c=e.i(812618);e.s(["default",0,({reasoningContent:e})=>{let[p,d]=(0,o.useState)(!0);return e?(0,t.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,t.jsxs)(n.Button,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>d(!p),icon:(0,t.jsx)(c.BulbOutlined,{}),children:[p?"Hide reasoning":"Show reasoning",p?(0,t.jsx)(r.DownOutlined,{className:"ml-1"}):(0,t.jsx)(l.RightOutlined,{className:"ml-1"})]}),p&&(0,t.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,t.jsx)(i.default,{components:{code({node:e,inline:o,className:n,children:i,...r}){let l=/language-(\w+)/.exec(n||"");return!o&&l?(0,t.jsx)(a.Prism,{style:s.coy,language:l[1],PreTag:"div",className:"rounded-md my-2",...r,children:String(i).replace(/\n$/,"")}):(0,t.jsx)("code",{className:`${n} px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono`,...r,children:i})}},children:e})})]}):null}])},84899,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"},i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["SendOutlined",0,a],84899)},782273,793916,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M625.9 115c-5.9 0-11.9 1.6-17.4 5.3L254 352H90c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h164l354.5 231.7c5.5 3.6 11.6 5.3 17.4 5.3 16.7 0 32.1-13.3 32.1-32.1V147.1c0-18.8-15.4-32.1-32.1-32.1zM586 803L293.4 611.7l-18-11.7H146V424h129.4l17.9-11.7L586 221v582zm348-327H806c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16h128c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16zm-41.9 261.8l-110.3-63.7a15.9 15.9 0 00-21.7 5.9l-19.9 34.5c-4.4 7.6-1.8 17.4 5.8 21.8L856.3 800a15.9 15.9 0 0021.7-5.9l19.9-34.5c4.4-7.6 1.7-17.4-5.8-21.8zM760 344a15.9 15.9 0 0021.7 5.9L892 286.2c7.6-4.4 10.2-14.2 5.8-21.8L878 230a15.9 15.9 0 00-21.7-5.9L746 287.8a15.99 15.99 0 00-5.8 21.8L760 344z"}}]},name:"sound",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["SoundOutlined",0,a],782273);let s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"}}]},name:"audio",theme:"outlined"};var r=o.forwardRef(function(e,n){return o.createElement(i.default,(0,t.default)({},e,{ref:n,icon:s}))});e.s(["AudioOutlined",0,r],793916)},190272,785913,e=>{"use strict";var t,o,n=((t={}).AUDIO_SPEECH="audio_speech",t.AUDIO_TRANSCRIPTION="audio_transcription",t.IMAGE_GENERATION="image_generation",t.VIDEO_GENERATION="video_generation",t.CHAT="chat",t.RESPONSES="responses",t.IMAGE_EDITS="image_edits",t.ANTHROPIC_MESSAGES="anthropic_messages",t.EMBEDDING="embedding",t),i=((o={}).IMAGE="image",o.VIDEO="video",o.CHAT="chat",o.RESPONSES="responses",o.IMAGE_EDITS="image_edits",o.ANTHROPIC_MESSAGES="anthropic_messages",o.EMBEDDINGS="embeddings",o.SPEECH="speech",o.TRANSCRIPTION="transcription",o.A2A_AGENTS="a2a_agents",o.MCP="mcp",o.REALTIME="realtime",o);let a={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings"};e.s(["EndpointType",()=>i,"getEndpointType",0,e=>{if(console.log("getEndpointType:",e),Object.values(n).includes(e)){let t=a[e];return console.log("endpointType:",t),t}return"chat"}],785913),e.s(["generateCodeSnippet",0,e=>{let t,{apiKeySource:o,accessToken:n,apiKey:a,inputMessage:s,chatHistory:r,selectedTags:l,selectedVectorStores:c,selectedGuardrails:p,selectedPolicies:d,selectedMCPServers:m,mcpServers:u,mcpServerToolRestrictions:f,selectedVoice:g,endpointType:h,selectedModel:_,selectedSdk:b,proxySettings:v}=e,x="session"===o?n:a,y=window.location.origin,w=v?.LITELLM_UI_API_DOC_BASE_URL;w&&w.trim()?y=w:v?.PROXY_BASE_URL&&(y=v.PROXY_BASE_URL);let j=s||"Your prompt here",S=j.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),k=r.filter(e=>!e.isImage).map(({role:e,content:t})=>({role:e,content:t})),C={};l.length>0&&(C.tags=l),c.length>0&&(C.vector_stores=c),p.length>0&&(C.guardrails=p),d.length>0&&(C.policies=d);let O=_||"your-model-name",E="azure"===b?`import openai | |||
| @@ -3,6 +3,7 @@ | |||
| import { render, screen, waitFor, fireEvent, act } from "@testing-library/react"; | |||
| import MCPServerEdit from "./mcp_server_edit"; | |||
| import * as networking from "../networking"; | |||
| import NotificationsManager from "../molecules/notifications_manager"; | |||
| @@ -0,0 +1,420 @@ | |||
| (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,190272,785913,e=>{"use strict";var t,o,i=((t={}).AUDIO_SPEECH="audio_speech",t.AUDIO_TRANSCRIPTION="audio_transcription",t.IMAGE_GENERATION="image_generation",t.VIDEO_GENERATION="video_generation",t.CHAT="chat",t.RESPONSES="responses",t.IMAGE_EDITS="image_edits",t.ANTHROPIC_MESSAGES="anthropic_messages",t.EMBEDDING="embedding",t),a=((o={}).IMAGE="image",o.VIDEO="video",o.CHAT="chat",o.RESPONSES="responses",o.IMAGE_EDITS="image_edits",o.ANTHROPIC_MESSAGES="anthropic_messages",o.EMBEDDINGS="embeddings",o.SPEECH="speech",o.TRANSCRIPTION="transcription",o.A2A_AGENTS="a2a_agents",o.MCP="mcp",o.REALTIME="realtime",o);let n={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings"};e.s(["EndpointType",()=>a,"getEndpointType",0,e=>{if(console.log("getEndpointType:",e),Object.values(i).includes(e)){let t=n[e];return console.log("endpointType:",t),t}return"chat"}],785913),e.s(["generateCodeSnippet",0,e=>{let t,{apiKeySource:o,accessToken:i,apiKey:n,inputMessage:r,chatHistory:s,selectedTags:l,selectedVectorStores:c,selectedGuardrails:d,selectedPolicies:p,selectedMCPServers:m,mcpServers:u,mcpServerToolRestrictions:f,selectedVoice:g,endpointType:h,selectedModel:_,selectedSdk:b,proxySettings:x}=e,v="session"===o?i:n,y=window.location.origin,j=x?.LITELLM_UI_API_DOC_BASE_URL;j&&j.trim()?y=j:x?.PROXY_BASE_URL&&(y=x.PROXY_BASE_URL);let w=r||"Your prompt here",S=w.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),k=s.filter(e=>!e.isImage).map(({role:e,content:t})=>({role:e,content:t})),C={};l.length>0&&(C.tags=l),c.length>0&&(C.vector_stores=c),d.length>0&&(C.guardrails=d),p.length>0&&(C.policies=p);let N=_||"your-model-name",O="azure"===b?`import openai | |||
| @@ -0,0 +1,420 @@ | |||
| (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,190272,785913,e=>{"use strict";var t,o,i=((t={}).AUDIO_SPEECH="audio_speech",t.AUDIO_TRANSCRIPTION="audio_transcription",t.IMAGE_GENERATION="image_generation",t.VIDEO_GENERATION="video_generation",t.CHAT="chat",t.RESPONSES="responses",t.IMAGE_EDITS="image_edits",t.ANTHROPIC_MESSAGES="anthropic_messages",t.EMBEDDING="embedding",t),a=((o={}).IMAGE="image",o.VIDEO="video",o.CHAT="chat",o.RESPONSES="responses",o.IMAGE_EDITS="image_edits",o.ANTHROPIC_MESSAGES="anthropic_messages",o.EMBEDDINGS="embeddings",o.SPEECH="speech",o.TRANSCRIPTION="transcription",o.A2A_AGENTS="a2a_agents",o.MCP="mcp",o.REALTIME="realtime",o);let n={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings"};e.s(["EndpointType",()=>a,"getEndpointType",0,e=>{if(console.log("getEndpointType:",e),Object.values(i).includes(e)){let t=n[e];return console.log("endpointType:",t),t}return"chat"}],785913),e.s(["generateCodeSnippet",0,e=>{let t,{apiKeySource:o,accessToken:i,apiKey:n,inputMessage:r,chatHistory:s,selectedTags:l,selectedVectorStores:c,selectedGuardrails:d,selectedPolicies:p,selectedMCPServers:m,mcpServers:u,mcpServerToolRestrictions:f,selectedVoice:g,endpointType:h,selectedModel:_,selectedSdk:b,proxySettings:x}=e,v="session"===o?i:n,y=window.location.origin,j=x?.LITELLM_UI_API_DOC_BASE_URL;j&&j.trim()?y=j:x?.PROXY_BASE_URL&&(y=x.PROXY_BASE_URL);let w=r||"Your prompt here",S=w.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),k=s.filter(e=>!e.isImage).map(({role:e,content:t})=>({role:e,content:t})),C={};l.length>0&&(C.tags=l),c.length>0&&(C.vector_stores=c),d.length>0&&(C.guardrails=d),p.length>0&&(C.policies=p);let N=_||"your-model-name",O="azure"===b?`import openai | |||
| @@ -0,0 +1,420 @@ | |||
| (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,434166,e=>{"use strict";function t(e,t){window.sessionStorage.setItem(e,btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))))}function o(e){try{let t=window.sessionStorage.getItem(e);if(null===t)return null;return decodeURIComponent(atob(t).split("").map(e=>"%"+e.charCodeAt(0).toString(16).padStart(2,"0")).join(""))}catch{return null}}e.s(["getSecureItem",()=>o,"setSecureItem",()=>t])},596239,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["LinkOutlined",0,a],596239)},166406,e=>{"use strict";var t=e.i(190144);e.s(["CopyOutlined",()=>t.default])},240647,e=>{"use strict";var t=e.i(286612);e.s(["RightOutlined",()=>t.default])},362024,e=>{"use strict";var t=e.i(988122);e.s(["Collapse",()=>t.default])},516015,(e,t,o)=>{},898547,(e,t,o)=>{var n=e.i(247167);e.r(516015);var i=e.r(271645),a=i&&"object"==typeof i&&"default"in i?i:{default:i},s=void 0!==n.default&&n.default.env&&!0,r=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,o=t.name,n=void 0===o?"stylesheet":o,i=t.optimizeForSpeed,a=void 0===i?s:i;c(r(n),"`name` must be a string"),this._name=n,this._deletedRulePlaceholder="#"+n+"-deleted-rule____{}",c("boolean"==typeof a,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=a,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var l="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=l?l.getAttribute("content"):null}var t,o=e.prototype;return o.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},o.isOptimizeForSpeed=function(){return this._optimizeForSpeed},o.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(s||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,o){return"number"==typeof o?e._serverSheet.cssRules[o]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),o},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},o.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},o.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},o.insertRule=function(e,t){if(c(r(e),"`insertRule` accepts only strings"),"u"<typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var o=this.getSheet();"number"!=typeof t&&(t=o.cssRules.length);try{o.insertRule(e,t)}catch(t){return s||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var n=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,n))}return this._rulesCount++},o.replaceRule=function(e,t){if(this._optimizeForSpeed||"u"<typeof window){var o="u">typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!o.cssRules[e])return e;o.deleteRule(e);try{o.insertRule(t,e)}catch(n){s||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),o.insertRule(this._deletedRulePlaceholder,e)}}else{var n=this._tags[e];c(n,"old rule at index `"+e+"` not found"),n.textContent=t}return e},o.deleteRule=function(e){if("u"<typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},o.flush=function(){this._injected=!1,this._rulesCount=0,"u">typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},o.cssRules=function(){var e=this;return"u"<typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,o){return o?t=t.concat(Array.prototype.map.call(e.getSheetForTag(o).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},o.makeStyleTag=function(e,t,o){t&&c(r(t),"makeStyleTag accepts only strings as second parameter");var n=document.createElement("style");this._nonce&&n.setAttribute("nonce",this._nonce),n.type="text/css",n.setAttribute("data-"+e,""),t&&n.appendChild(document.createTextNode(t));var i=document.head||document.getElementsByTagName("head")[0];return o?i.insertBefore(n,o):i.appendChild(n),n},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var p=function(e){for(var t=5381,o=e.length;o;)t=33*t^e.charCodeAt(--o);return t>>>0},d={};function m(e,t){if(!t)return"jsx-"+e;var o=String(t),n=e+o;return d[n]||(d[n]="jsx-"+p(e+"-"+o)),d[n]}function u(e,t){"u"<typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var o=e+t;return d[o]||(d[o]=t.replace(/__jsx-style-dynamic-selector/g,e)),d[o]}var f=function(){function e(e){var t=void 0===e?{}:e,o=t.styleSheet,n=void 0===o?null:o,i=t.optimizeForSpeed,a=void 0!==i&&i;this._sheet=n||new l({name:"styled-jsx",optimizeForSpeed:a}),this._sheet.inject(),n&&"boolean"==typeof a&&(this._sheet.setOptimizeForSpeed(a),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"u">typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var o=this.getIdAndRules(e),n=o.styleId,i=o.rules;if(n in this._instancesCounts){this._instancesCounts[n]+=1;return}var a=i.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[n]=a,this._instancesCounts[n]=1},t.remove=function(e){var t=this,o=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(o in this._instancesCounts,"styleId: `"+o+"` not found"),this._instancesCounts[o]-=1,this._instancesCounts[o]<1){var n=this._fromServer&&this._fromServer[o];n?(n.parentNode.removeChild(n),delete this._fromServer[o]):(this._indices[o].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[o]),delete this._instancesCounts[o]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],o=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return o[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,o;return t=this.cssRules(),void 0===(o=e)&&(o={}),t.map(function(e){var t=e[0],n=e[1];return a.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:o.nonce?o.nonce:void 0,dangerouslySetInnerHTML:{__html:n}})})},t.getIdAndRules=function(e){var t=e.children,o=e.dynamic,n=e.id;if(o){var i=m(n,o);return{styleId:i,rules:Array.isArray(t)?t.map(function(e){return u(i,e)}):[u(i,t)]}}return{styleId:m(n),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),g=i.createContext(null);function h(){return new f}function _(){return i.useContext(g)}g.displayName="StyleSheetContext";var b=a.default.useInsertionEffect||a.default.useLayoutEffect,v="u">typeof window?h():void 0;function x(e){var t=v||_();return t&&("u"<typeof window?t.add(e):b(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}x.dynamic=function(e){return e.map(function(e){return m(e[0],e[1])}).join(" ")},o.StyleRegistry=function(e){var t=e.registry,o=e.children,n=i.useContext(g),s=i.useState(function(){return n||t||h()})[0];return a.default.createElement(g.Provider,{value:s},o)},o.createStyleRegistry=h,o.style=x,o.useStyleRegistry=_},437902,(e,t,o)=>{t.exports=e.r(898547).style},254530,452598,e=>{"use strict";e.i(247167);var t=e.i(356449),o=e.i(764205);async function n(e,n,i,a,s,r,l,c,p,d,m,u,f,g,h,_,b,v,x,y,w,j,S,k,C){console.log=function(){},console.log("isLocal:",!1);let O=y||(0,o.getProxyBaseUrl)(),E={};s&&s.length>0&&(E["x-litellm-tags"]=s.join(","));let T=new t.default.OpenAI({apiKey:a,baseURL:O,dangerouslyAllowBrowser:!0,defaultHeaders:E});try{let t,o=Date.now(),a=!1,s={},y=!1,O=[];for await(let x of(g&&g.length>0&&(g.includes("__all__")?O.push({type:"mcp",server_label:"litellm",server_url:"litellm_proxy/mcp",require_approval:"never"}):g.forEach(e=>{if(e.startsWith("toolset:")){let t=e.slice(8),o=C?.find(e=>e.toolset_id===t),n=o?.toolset_name||t;O.push({type:"mcp",server_label:n,server_url:`litellm_proxy/mcp/${encodeURIComponent(n)}`,require_approval:"never"})}else{let t=w?.find(t=>t.server_id===e),o=t?.alias||t?.server_name||e,n=j?.[e]||[];O.push({type:"mcp",server_label:"litellm",server_url:`litellm_proxy/mcp/${o}`,require_approval:"never",...n.length>0?{allowed_tools:n}:{}})}})),await T.chat.completions.create({model:i,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:d,messages:e,...m?{vector_store_ids:m}:{},...u?{guardrails:u}:{},...f?{policies:f}:{},...O.length>0?{tools:O,tool_choice:"auto"}:{},...void 0!==b?{temperature:b}:{},...void 0!==v?{max_tokens:v}:{},...k?{mock_testing_fallbacks:!0}:{}},{signal:r}))){console.log("Stream chunk:",x);let e=x.choices[0]?.delta;if(console.log("Delta content:",x.choices[0]?.delta?.content),console.log("Delta reasoning content:",e?.reasoning_content),!a&&(x.choices[0]?.delta?.content||e&&e.reasoning_content)&&(a=!0,t=Date.now()-o,console.log("First token received! Time:",t,"ms"),c?(console.log("Calling onTimingData with:",t),c(t)):console.log("onTimingData callback is not defined!")),x.choices[0]?.delta?.content){let e=x.choices[0].delta.content;n(e,x.model)}if(e&&e.image&&h&&(console.log("Image generated:",e.image),h(e.image.url,x.model)),e&&e.reasoning_content){let t=e.reasoning_content;l&&l(t)}if(e&&e.provider_specific_fields?.search_results&&_&&(console.log("Search results found:",e.provider_specific_fields.search_results),_(e.provider_specific_fields.search_results)),e&&e.provider_specific_fields){let t=e.provider_specific_fields;if(t.mcp_list_tools&&!s.mcp_list_tools&&(s.mcp_list_tools=t.mcp_list_tools,S&&!y)){y=!0;let e={type:"response.output_item.done",item_id:"mcp_list_tools",item:{type:"mcp_list_tools",tools:t.mcp_list_tools.map(e=>({name:e.function?.name||e.name||"",description:e.function?.description||e.description||"",input_schema:e.function?.parameters||e.input_schema||{}}))},timestamp:Date.now()};S(e),console.log("MCP list_tools event sent:",e)}t.mcp_tool_calls&&(s.mcp_tool_calls=t.mcp_tool_calls),t.mcp_call_results&&(s.mcp_call_results=t.mcp_call_results),(t.mcp_list_tools||t.mcp_tool_calls||t.mcp_call_results)&&console.log("MCP metadata found in chunk:",{mcp_list_tools:t.mcp_list_tools?"present":"absent",mcp_tool_calls:t.mcp_tool_calls?"present":"absent",mcp_call_results:t.mcp_call_results?"present":"absent"})}if(x.usage&&p){console.log("Usage data found:",x.usage);let e={completionTokens:x.usage.completion_tokens,promptTokens:x.usage.prompt_tokens,totalTokens:x.usage.total_tokens};x.usage.completion_tokens_details?.reasoning_tokens&&(e.reasoningTokens=x.usage.completion_tokens_details.reasoning_tokens),void 0!==x.usage.cost&&null!==x.usage.cost&&(e.cost=parseFloat(x.usage.cost)),p(e)}}S&&(s.mcp_tool_calls||s.mcp_call_results)&&s.mcp_tool_calls&&s.mcp_tool_calls.length>0&&s.mcp_tool_calls.forEach((e,t)=>{let o=e.function?.name||e.name||"",n=e.function?.arguments||e.arguments||"{}",i=s.mcp_call_results?.find(t=>t.tool_call_id===e.id||t.tool_call_id===e.call_id)||s.mcp_call_results?.[t],a={type:"response.output_item.done",item:{type:"mcp_call",name:o,arguments:"string"==typeof n?n:JSON.stringify(n),output:i?.result?"string"==typeof i.result?i.result:JSON.stringify(i.result):void 0},item_id:e.id||e.call_id,timestamp:Date.now()};S(a),console.log("MCP call event sent:",a)});let E=Date.now();x&&x(E-o)}catch(e){throw r?.aborted&&console.log("Chat completion request was cancelled"),e}}e.s(["makeOpenAIChatCompletionRequest",()=>n],254530);var i=e.i(727749);async function a(e,n,s,r,l=[],c,p,d,m,u,f,g,h,_,b,v,x,y,w,j,S,k,C){if(!r)throw Error("Virtual Key is required");if(!s||""===s.trim())throw Error("Model is required. Please select a model before sending a request.");console.log=function(){};let O=j||(0,o.getProxyBaseUrl)(),E={};l&&l.length>0&&(E["x-litellm-tags"]=l.join(","));let T=new t.default.OpenAI({apiKey:r,baseURL:O,dangerouslyAllowBrowser:!0,defaultHeaders:E});try{let t=Date.now(),o=!1,i=e.map(e=>(Array.isArray(e.content),{role:e.role,content:e.content,type:"message"})),a=[];_&&_.length>0&&(_.includes("__all__")?a.push({type:"mcp",server_label:"litellm",server_url:`${O}/mcp`,require_approval:"never"}):_.forEach(e=>{if(e.startsWith("toolset:")){let t=e.slice(8),o=C?.find(e=>e.toolset_id===t),n=o?.toolset_name||t;a.push({type:"mcp",server_label:n,server_url:`${O}/mcp/${encodeURIComponent(n)}`,require_approval:"never"})}else{let t=S?.find(t=>t.server_id===e),o=t?.server_name||e,n=k?.[e]||[];a.push({type:"mcp",server_label:o,server_url:`${O}/mcp/${encodeURIComponent(o)}`,require_approval:"never",...n.length>0?{allowed_tools:n}:{}})}})),y&&a.push({type:"code_interpreter",container:{type:"auto"}});let r=await T.responses.create({model:s,input:i,stream:!0,litellm_trace_id:u,...b?{previous_response_id:b}:{},...f?{vector_store_ids:f}:{},...g?{guardrails:g}:{},...h?{policies:h}:{},...a.length>0?{tools:a,tool_choice:"auto"}:{}},{signal:c}),l="",j={code:"",containerId:""};for await(let e of r)if(console.log("Response event:",e),"object"==typeof e&&null!==e){if((e.type?.startsWith("response.mcp_")||"response.output_item.done"===e.type&&(e.item?.type==="mcp_list_tools"||e.item?.type==="mcp_call"))&&(console.log("MCP event received:",e),x)){let t={type:e.type,sequence_number:e.sequence_number,output_index:e.output_index,item_id:e.item_id||e.item?.id,item:e.item,delta:e.delta,arguments:e.arguments,timestamp:Date.now()};x(t)}"response.output_item.done"===e.type&&e.item?.type==="mcp_call"&&e.item?.name&&(l=e.item.name,console.log("MCP tool used:",l)),z=j;var z,R=j="response.output_item.done"===e.type&&e.item?.type==="code_interpreter_call"?(console.log("Code interpreter call completed:",e.item),{code:e.item.code||"",containerId:e.item.container_id||""}):z;if("response.output_item.done"===e.type&&e.item?.type==="message"&&e.item?.content&&w){for(let t of e.item.content)if("output_text"===t.type&&t.annotations){let e=t.annotations.filter(e=>"container_file_citation"===e.type);(e.length>0||R.code)&&w({code:R.code,containerId:R.containerId,annotations:e})}}if("response.role.delta"===e.type)continue;if("response.output_text.delta"===e.type&&"string"==typeof e.delta){let i=e.delta;if(console.log("Text delta",i),i.length>0&&(n("assistant",i,s),!o)){o=!0;let e=Date.now()-t;console.log("First token received! Time:",e,"ms"),d&&d(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let t=e.delta;"string"==typeof t&&p&&p(t)}if("response.completed"===e.type&&"response"in e){let t=e.response,o=t.usage;if(console.log("Usage data:",o),console.log("Response completed event:",t),t.id&&v&&(console.log("Response ID for session management:",t.id),v(t.id)),o&&m){console.log("Usage data:",o);let e={completionTokens:o.output_tokens,promptTokens:o.input_tokens,totalTokens:o.total_tokens};o.completion_tokens_details?.reasoning_tokens&&(e.reasoningTokens=o.completion_tokens_details.reasoning_tokens),m(e,l)}}}return r}catch(e){throw c?.aborted?console.log("Responses API request was cancelled"):i.default.fromBackend(`Error occurred while generating model response. Please try again. Error: ${e}`),e}}e.s(["makeOpenAIResponsesRequest",()=>a],452598)},355343,e=>{"use strict";var t=e.i(843476),o=e.i(437902),n=e.i(898586),i=e.i(362024);let{Text:a}=n.Typography,{Panel:s}=i.Collapse;e.s(["default",0,({events:e,className:n})=>{if(console.log("MCPEventsDisplay: Received events:",e),!e||0===e.length)return console.log("MCPEventsDisplay: No events, returning null"),null;let a=e.find(e=>"response.output_item.done"===e.type&&e.item?.type==="mcp_list_tools"&&e.item.tools&&e.item.tools.length>0),r=e.filter(e=>"response.output_item.done"===e.type&&e.item?.type==="mcp_call");return(console.log("MCPEventsDisplay: toolsEvent:",a),console.log("MCPEventsDisplay: mcpCallEvents:",r),a||0!==r.length)?(0,t.jsxs)("div",{className:`jsx-32b14b04f420f3ac mcp-events-display ${n||""}`,children:[(0,t.jsx)(o.default,{id:"32b14b04f420f3ac",children:".openai-mcp-tools.jsx-32b14b04f420f3ac{margin:0;padding:0;position:relative}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse.jsx-32b14b04f420f3ac,.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-item.jsx-32b14b04f420f3ac{background:0 0!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac{color:#9ca3af!important;background:0 0!important;border:none!important;min-height:20px!important;padding:0 0 0 20px!important;font-size:14px!important;font-weight:400!important;line-height:20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac:hover{color:#6b7280!important;background:0 0!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content.jsx-32b14b04f420f3ac{background:0 0!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content-box.jsx-32b14b04f420f3ac{padding:4px 0 0 20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac{color:#9ca3af!important;justify-content:center!important;align-items:center!important;width:16px!important;height:16px!important;font-size:10px!important;display:flex!important;position:absolute!important;top:2px!important;left:2px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac:hover{color:#6b7280!important}.openai-vertical-line.jsx-32b14b04f420f3ac{opacity:.8;background-color:#f3f4f6;width:.5px;position:absolute;top:18px;bottom:0;left:9px}.tool-item.jsx-32b14b04f420f3ac{color:#4b5563;z-index:1;background:#fff;margin:0;padding:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:18px;position:relative}.mcp-section.jsx-32b14b04f420f3ac{z-index:1;background:#fff;margin-bottom:12px;position:relative}.mcp-section.jsx-32b14b04f420f3ac:last-child{margin-bottom:0}.mcp-section-header.jsx-32b14b04f420f3ac{color:#6b7280;margin-bottom:4px;font-size:13px;font-weight:500}.mcp-code-block.jsx-32b14b04f420f3ac{background:#f9fafb;border:1px solid #f3f4f6;border-radius:6px;padding:8px;font-size:12px}.mcp-json.jsx-32b14b04f420f3ac{color:#374151;white-space:pre-wrap;word-wrap:break-word;margin:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace}.mcp-approved.jsx-32b14b04f420f3ac{color:#6b7280;align-items:center;font-size:13px;display:flex}.mcp-checkmark.jsx-32b14b04f420f3ac{color:#10b981;margin-right:6px;font-weight:700}.mcp-response-content.jsx-32b14b04f420f3ac{color:#374151;white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.5}"}),(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac openai-mcp-tools",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac openai-vertical-line"}),(0,t.jsxs)(i.Collapse,{ghost:!0,size:"small",expandIconPosition:"start",defaultActiveKey:a?["list-tools"]:r.map((e,t)=>`mcp-call-${t}`),children:[a&&(0,t.jsx)(s,{header:"List tools",children:(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac",children:a.item?.tools?.map((e,o)=>(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac tool-item",children:e.name},o))})},"list-tools"),r.map((e,o)=>(0,t.jsx)(s,{header:e.item?.name||"Tool call",children:(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac",children:[(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Request"}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-code-block",children:e.item?.arguments&&(0,t.jsx)("pre",{className:"jsx-32b14b04f420f3ac mcp-json",children:(()=>{try{return JSON.stringify(JSON.parse(e.item.arguments),null,2)}catch(t){return e.item.arguments}})()})})]}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-approved",children:[(0,t.jsx)("span",{className:"jsx-32b14b04f420f3ac mcp-checkmark",children:"✓"})," Approved"]})}),e.item?.output&&(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Response"}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-response-content",children:e.item.output})]})]})},`mcp-call-${o}`))]})]})]}):(console.log("MCPEventsDisplay: No valid events found, returning null"),null)}])},966988,e=>{"use strict";var t=e.i(843476),o=e.i(271645),n=e.i(464571),i=e.i(918789),a=e.i(650056),s=e.i(219470),r=e.i(755151),l=e.i(240647),c=e.i(812618);e.s(["default",0,({reasoningContent:e})=>{let[p,d]=(0,o.useState)(!0);return e?(0,t.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,t.jsxs)(n.Button,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>d(!p),icon:(0,t.jsx)(c.BulbOutlined,{}),children:[p?"Hide reasoning":"Show reasoning",p?(0,t.jsx)(r.DownOutlined,{className:"ml-1"}):(0,t.jsx)(l.RightOutlined,{className:"ml-1"})]}),p&&(0,t.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,t.jsx)(i.default,{components:{code({node:e,inline:o,className:n,children:i,...r}){let l=/language-(\w+)/.exec(n||"");return!o&&l?(0,t.jsx)(a.Prism,{style:s.coy,language:l[1],PreTag:"div",className:"rounded-md my-2",...r,children:String(i).replace(/\n$/,"")}):(0,t.jsx)("code",{className:`${n} px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono`,...r,children:i})}},children:e})})]}):null}])},84899,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"},i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["SendOutlined",0,a],84899)},782273,793916,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M625.9 115c-5.9 0-11.9 1.6-17.4 5.3L254 352H90c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h164l354.5 231.7c5.5 3.6 11.6 5.3 17.4 5.3 16.7 0 32.1-13.3 32.1-32.1V147.1c0-18.8-15.4-32.1-32.1-32.1zM586 803L293.4 611.7l-18-11.7H146V424h129.4l17.9-11.7L586 221v582zm348-327H806c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16h128c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16zm-41.9 261.8l-110.3-63.7a15.9 15.9 0 00-21.7 5.9l-19.9 34.5c-4.4 7.6-1.8 17.4 5.8 21.8L856.3 800a15.9 15.9 0 0021.7-5.9l19.9-34.5c4.4-7.6 1.7-17.4-5.8-21.8zM760 344a15.9 15.9 0 0021.7 5.9L892 286.2c7.6-4.4 10.2-14.2 5.8-21.8L878 230a15.9 15.9 0 00-21.7-5.9L746 287.8a15.99 15.99 0 00-5.8 21.8L760 344z"}}]},name:"sound",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["SoundOutlined",0,a],782273);let s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"}}]},name:"audio",theme:"outlined"};var r=o.forwardRef(function(e,n){return o.createElement(i.default,(0,t.default)({},e,{ref:n,icon:s}))});e.s(["AudioOutlined",0,r],793916)},190272,785913,e=>{"use strict";var t,o,n=((t={}).AUDIO_SPEECH="audio_speech",t.AUDIO_TRANSCRIPTION="audio_transcription",t.IMAGE_GENERATION="image_generation",t.VIDEO_GENERATION="video_generation",t.CHAT="chat",t.RESPONSES="responses",t.IMAGE_EDITS="image_edits",t.ANTHROPIC_MESSAGES="anthropic_messages",t.EMBEDDING="embedding",t),i=((o={}).IMAGE="image",o.VIDEO="video",o.CHAT="chat",o.RESPONSES="responses",o.IMAGE_EDITS="image_edits",o.ANTHROPIC_MESSAGES="anthropic_messages",o.EMBEDDINGS="embeddings",o.SPEECH="speech",o.TRANSCRIPTION="transcription",o.A2A_AGENTS="a2a_agents",o.MCP="mcp",o.REALTIME="realtime",o);let a={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings"};e.s(["EndpointType",()=>i,"getEndpointType",0,e=>{if(console.log("getEndpointType:",e),Object.values(n).includes(e)){let t=a[e];return console.log("endpointType:",t),t}return"chat"}],785913),e.s(["generateCodeSnippet",0,e=>{let t,{apiKeySource:o,accessToken:n,apiKey:a,inputMessage:s,chatHistory:r,selectedTags:l,selectedVectorStores:c,selectedGuardrails:p,selectedPolicies:d,selectedMCPServers:m,mcpServers:u,mcpServerToolRestrictions:f,selectedVoice:g,endpointType:h,selectedModel:_,selectedSdk:b,proxySettings:v}=e,x="session"===o?n:a,y=window.location.origin,w=v?.LITELLM_UI_API_DOC_BASE_URL;w&&w.trim()?y=w:v?.PROXY_BASE_URL&&(y=v.PROXY_BASE_URL);let j=s||"Your prompt here",S=j.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),k=r.filter(e=>!e.isImage).map(({role:e,content:t})=>({role:e,content:t})),C={};l.length>0&&(C.tags=l),c.length>0&&(C.vector_stores=c),p.length>0&&(C.guardrails=p),d.length>0&&(C.policies=d);let O=_||"your-model-name",E="azure"===b?`import openai | |||
| @@ -0,0 +1,420 @@ | |||
| (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,434166,e=>{"use strict";function t(e,t){window.sessionStorage.setItem(e,btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))))}function o(e){try{let t=window.sessionStorage.getItem(e);if(null===t)return null;return decodeURIComponent(atob(t).split("").map(e=>"%"+e.charCodeAt(0).toString(16).padStart(2,"0")).join(""))}catch{return null}}e.s(["getSecureItem",()=>o,"setSecureItem",()=>t])},596239,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["LinkOutlined",0,a],596239)},166406,e=>{"use strict";var t=e.i(190144);e.s(["CopyOutlined",()=>t.default])},240647,e=>{"use strict";var t=e.i(286612);e.s(["RightOutlined",()=>t.default])},362024,e=>{"use strict";var t=e.i(988122);e.s(["Collapse",()=>t.default])},516015,(e,t,o)=>{},898547,(e,t,o)=>{var n=e.i(247167);e.r(516015);var i=e.r(271645),a=i&&"object"==typeof i&&"default"in i?i:{default:i},s=void 0!==n.default&&n.default.env&&!0,r=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,o=t.name,n=void 0===o?"stylesheet":o,i=t.optimizeForSpeed,a=void 0===i?s:i;c(r(n),"`name` must be a string"),this._name=n,this._deletedRulePlaceholder="#"+n+"-deleted-rule____{}",c("boolean"==typeof a,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=a,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var l="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=l?l.getAttribute("content"):null}var t,o=e.prototype;return o.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},o.isOptimizeForSpeed=function(){return this._optimizeForSpeed},o.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(s||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,o){return"number"==typeof o?e._serverSheet.cssRules[o]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),o},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},o.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},o.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},o.insertRule=function(e,t){if(c(r(e),"`insertRule` accepts only strings"),"u"<typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var o=this.getSheet();"number"!=typeof t&&(t=o.cssRules.length);try{o.insertRule(e,t)}catch(t){return s||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var n=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,n))}return this._rulesCount++},o.replaceRule=function(e,t){if(this._optimizeForSpeed||"u"<typeof window){var o="u">typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!o.cssRules[e])return e;o.deleteRule(e);try{o.insertRule(t,e)}catch(n){s||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),o.insertRule(this._deletedRulePlaceholder,e)}}else{var n=this._tags[e];c(n,"old rule at index `"+e+"` not found"),n.textContent=t}return e},o.deleteRule=function(e){if("u"<typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},o.flush=function(){this._injected=!1,this._rulesCount=0,"u">typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},o.cssRules=function(){var e=this;return"u"<typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,o){return o?t=t.concat(Array.prototype.map.call(e.getSheetForTag(o).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},o.makeStyleTag=function(e,t,o){t&&c(r(t),"makeStyleTag accepts only strings as second parameter");var n=document.createElement("style");this._nonce&&n.setAttribute("nonce",this._nonce),n.type="text/css",n.setAttribute("data-"+e,""),t&&n.appendChild(document.createTextNode(t));var i=document.head||document.getElementsByTagName("head")[0];return o?i.insertBefore(n,o):i.appendChild(n),n},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var p=function(e){for(var t=5381,o=e.length;o;)t=33*t^e.charCodeAt(--o);return t>>>0},d={};function m(e,t){if(!t)return"jsx-"+e;var o=String(t),n=e+o;return d[n]||(d[n]="jsx-"+p(e+"-"+o)),d[n]}function u(e,t){"u"<typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var o=e+t;return d[o]||(d[o]=t.replace(/__jsx-style-dynamic-selector/g,e)),d[o]}var f=function(){function e(e){var t=void 0===e?{}:e,o=t.styleSheet,n=void 0===o?null:o,i=t.optimizeForSpeed,a=void 0!==i&&i;this._sheet=n||new l({name:"styled-jsx",optimizeForSpeed:a}),this._sheet.inject(),n&&"boolean"==typeof a&&(this._sheet.setOptimizeForSpeed(a),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"u">typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var o=this.getIdAndRules(e),n=o.styleId,i=o.rules;if(n in this._instancesCounts){this._instancesCounts[n]+=1;return}var a=i.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[n]=a,this._instancesCounts[n]=1},t.remove=function(e){var t=this,o=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(o in this._instancesCounts,"styleId: `"+o+"` not found"),this._instancesCounts[o]-=1,this._instancesCounts[o]<1){var n=this._fromServer&&this._fromServer[o];n?(n.parentNode.removeChild(n),delete this._fromServer[o]):(this._indices[o].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[o]),delete this._instancesCounts[o]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],o=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return o[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,o;return t=this.cssRules(),void 0===(o=e)&&(o={}),t.map(function(e){var t=e[0],n=e[1];return a.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:o.nonce?o.nonce:void 0,dangerouslySetInnerHTML:{__html:n}})})},t.getIdAndRules=function(e){var t=e.children,o=e.dynamic,n=e.id;if(o){var i=m(n,o);return{styleId:i,rules:Array.isArray(t)?t.map(function(e){return u(i,e)}):[u(i,t)]}}return{styleId:m(n),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),g=i.createContext(null);function h(){return new f}function _(){return i.useContext(g)}g.displayName="StyleSheetContext";var b=a.default.useInsertionEffect||a.default.useLayoutEffect,v="u">typeof window?h():void 0;function x(e){var t=v||_();return t&&("u"<typeof window?t.add(e):b(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}x.dynamic=function(e){return e.map(function(e){return m(e[0],e[1])}).join(" ")},o.StyleRegistry=function(e){var t=e.registry,o=e.children,n=i.useContext(g),s=i.useState(function(){return n||t||h()})[0];return a.default.createElement(g.Provider,{value:s},o)},o.createStyleRegistry=h,o.style=x,o.useStyleRegistry=_},437902,(e,t,o)=>{t.exports=e.r(898547).style},254530,452598,e=>{"use strict";e.i(247167);var t=e.i(356449),o=e.i(764205);async function n(e,n,i,a,s,r,l,c,p,d,m,u,f,g,h,_,b,v,x,y,w,j,S,k,C){console.log=function(){},console.log("isLocal:",!1);let O=y||(0,o.getProxyBaseUrl)(),E={};s&&s.length>0&&(E["x-litellm-tags"]=s.join(","));let T=new t.default.OpenAI({apiKey:a,baseURL:O,dangerouslyAllowBrowser:!0,defaultHeaders:E});try{let t,o=Date.now(),a=!1,s={},y=!1,O=[];for await(let x of(g&&g.length>0&&(g.includes("__all__")?O.push({type:"mcp",server_label:"litellm",server_url:"litellm_proxy/mcp",require_approval:"never"}):g.forEach(e=>{if(e.startsWith("toolset:")){let t=e.slice(8),o=C?.find(e=>e.toolset_id===t),n=o?.toolset_name||t;O.push({type:"mcp",server_label:n,server_url:`litellm_proxy/mcp/${encodeURIComponent(n)}`,require_approval:"never"})}else{let t=w?.find(t=>t.server_id===e),o=t?.alias||t?.server_name||e,n=j?.[e]||[];O.push({type:"mcp",server_label:"litellm",server_url:`litellm_proxy/mcp/${o}`,require_approval:"never",...n.length>0?{allowed_tools:n}:{}})}})),await T.chat.completions.create({model:i,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:d,messages:e,...m?{vector_store_ids:m}:{},...u?{guardrails:u}:{},...f?{policies:f}:{},...O.length>0?{tools:O,tool_choice:"auto"}:{},...void 0!==b?{temperature:b}:{},...void 0!==v?{max_tokens:v}:{},...k?{mock_testing_fallbacks:!0}:{}},{signal:r}))){console.log("Stream chunk:",x);let e=x.choices[0]?.delta;if(console.log("Delta content:",x.choices[0]?.delta?.content),console.log("Delta reasoning content:",e?.reasoning_content),!a&&(x.choices[0]?.delta?.content||e&&e.reasoning_content)&&(a=!0,t=Date.now()-o,console.log("First token received! Time:",t,"ms"),c?(console.log("Calling onTimingData with:",t),c(t)):console.log("onTimingData callback is not defined!")),x.choices[0]?.delta?.content){let e=x.choices[0].delta.content;n(e,x.model)}if(e&&e.image&&h&&(console.log("Image generated:",e.image),h(e.image.url,x.model)),e&&e.reasoning_content){let t=e.reasoning_content;l&&l(t)}if(e&&e.provider_specific_fields?.search_results&&_&&(console.log("Search results found:",e.provider_specific_fields.search_results),_(e.provider_specific_fields.search_results)),e&&e.provider_specific_fields){let t=e.provider_specific_fields;if(t.mcp_list_tools&&!s.mcp_list_tools&&(s.mcp_list_tools=t.mcp_list_tools,S&&!y)){y=!0;let e={type:"response.output_item.done",item_id:"mcp_list_tools",item:{type:"mcp_list_tools",tools:t.mcp_list_tools.map(e=>({name:e.function?.name||e.name||"",description:e.function?.description||e.description||"",input_schema:e.function?.parameters||e.input_schema||{}}))},timestamp:Date.now()};S(e),console.log("MCP list_tools event sent:",e)}t.mcp_tool_calls&&(s.mcp_tool_calls=t.mcp_tool_calls),t.mcp_call_results&&(s.mcp_call_results=t.mcp_call_results),(t.mcp_list_tools||t.mcp_tool_calls||t.mcp_call_results)&&console.log("MCP metadata found in chunk:",{mcp_list_tools:t.mcp_list_tools?"present":"absent",mcp_tool_calls:t.mcp_tool_calls?"present":"absent",mcp_call_results:t.mcp_call_results?"present":"absent"})}if(x.usage&&p){console.log("Usage data found:",x.usage);let e={completionTokens:x.usage.completion_tokens,promptTokens:x.usage.prompt_tokens,totalTokens:x.usage.total_tokens};x.usage.completion_tokens_details?.reasoning_tokens&&(e.reasoningTokens=x.usage.completion_tokens_details.reasoning_tokens),void 0!==x.usage.cost&&null!==x.usage.cost&&(e.cost=parseFloat(x.usage.cost)),p(e)}}S&&(s.mcp_tool_calls||s.mcp_call_results)&&s.mcp_tool_calls&&s.mcp_tool_calls.length>0&&s.mcp_tool_calls.forEach((e,t)=>{let o=e.function?.name||e.name||"",n=e.function?.arguments||e.arguments||"{}",i=s.mcp_call_results?.find(t=>t.tool_call_id===e.id||t.tool_call_id===e.call_id)||s.mcp_call_results?.[t],a={type:"response.output_item.done",item:{type:"mcp_call",name:o,arguments:"string"==typeof n?n:JSON.stringify(n),output:i?.result?"string"==typeof i.result?i.result:JSON.stringify(i.result):void 0},item_id:e.id||e.call_id,timestamp:Date.now()};S(a),console.log("MCP call event sent:",a)});let E=Date.now();x&&x(E-o)}catch(e){throw r?.aborted&&console.log("Chat completion request was cancelled"),e}}e.s(["makeOpenAIChatCompletionRequest",()=>n],254530);var i=e.i(727749);async function a(e,n,s,r,l=[],c,p,d,m,u,f,g,h,_,b,v,x,y,w,j,S,k,C){if(!r)throw Error("Virtual Key is required");if(!s||""===s.trim())throw Error("Model is required. Please select a model before sending a request.");console.log=function(){};let O=j||(0,o.getProxyBaseUrl)(),E={};l&&l.length>0&&(E["x-litellm-tags"]=l.join(","));let T=new t.default.OpenAI({apiKey:r,baseURL:O,dangerouslyAllowBrowser:!0,defaultHeaders:E});try{let t=Date.now(),o=!1,i=e.map(e=>(Array.isArray(e.content),{role:e.role,content:e.content,type:"message"})),a=[];_&&_.length>0&&(_.includes("__all__")?a.push({type:"mcp",server_label:"litellm",server_url:`${O}/mcp`,require_approval:"never"}):_.forEach(e=>{if(e.startsWith("toolset:")){let t=e.slice(8),o=C?.find(e=>e.toolset_id===t),n=o?.toolset_name||t;a.push({type:"mcp",server_label:n,server_url:`${O}/mcp/${encodeURIComponent(n)}`,require_approval:"never"})}else{let t=S?.find(t=>t.server_id===e),o=t?.server_name||e,n=k?.[e]||[];a.push({type:"mcp",server_label:o,server_url:`${O}/mcp/${encodeURIComponent(o)}`,require_approval:"never",...n.length>0?{allowed_tools:n}:{}})}})),y&&a.push({type:"code_interpreter",container:{type:"auto"}});let r=await T.responses.create({model:s,input:i,stream:!0,litellm_trace_id:u,...b?{previous_response_id:b}:{},...f?{vector_store_ids:f}:{},...g?{guardrails:g}:{},...h?{policies:h}:{},...a.length>0?{tools:a,tool_choice:"auto"}:{}},{signal:c}),l="",j={code:"",containerId:""};for await(let e of r)if(console.log("Response event:",e),"object"==typeof e&&null!==e){if((e.type?.startsWith("response.mcp_")||"response.output_item.done"===e.type&&(e.item?.type==="mcp_list_tools"||e.item?.type==="mcp_call"))&&(console.log("MCP event received:",e),x)){let t={type:e.type,sequence_number:e.sequence_number,output_index:e.output_index,item_id:e.item_id||e.item?.id,item:e.item,delta:e.delta,arguments:e.arguments,timestamp:Date.now()};x(t)}"response.output_item.done"===e.type&&e.item?.type==="mcp_call"&&e.item?.name&&(l=e.item.name,console.log("MCP tool used:",l)),z=j;var z,R=j="response.output_item.done"===e.type&&e.item?.type==="code_interpreter_call"?(console.log("Code interpreter call completed:",e.item),{code:e.item.code||"",containerId:e.item.container_id||""}):z;if("response.output_item.done"===e.type&&e.item?.type==="message"&&e.item?.content&&w){for(let t of e.item.content)if("output_text"===t.type&&t.annotations){let e=t.annotations.filter(e=>"container_file_citation"===e.type);(e.length>0||R.code)&&w({code:R.code,containerId:R.containerId,annotations:e})}}if("response.role.delta"===e.type)continue;if("response.output_text.delta"===e.type&&"string"==typeof e.delta){let i=e.delta;if(console.log("Text delta",i),i.length>0&&(n("assistant",i,s),!o)){o=!0;let e=Date.now()-t;console.log("First token received! Time:",e,"ms"),d&&d(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let t=e.delta;"string"==typeof t&&p&&p(t)}if("response.completed"===e.type&&"response"in e){let t=e.response,o=t.usage;if(console.log("Usage data:",o),console.log("Response completed event:",t),t.id&&v&&(console.log("Response ID for session management:",t.id),v(t.id)),o&&m){console.log("Usage data:",o);let e={completionTokens:o.output_tokens,promptTokens:o.input_tokens,totalTokens:o.total_tokens};o.completion_tokens_details?.reasoning_tokens&&(e.reasoningTokens=o.completion_tokens_details.reasoning_tokens),m(e,l)}}}return r}catch(e){throw c?.aborted?console.log("Responses API request was cancelled"):i.default.fromBackend(`Error occurred while generating model response. Please try again. Error: ${e}`),e}}e.s(["makeOpenAIResponsesRequest",()=>a],452598)},355343,e=>{"use strict";var t=e.i(843476),o=e.i(437902),n=e.i(898586),i=e.i(362024);let{Text:a}=n.Typography,{Panel:s}=i.Collapse;e.s(["default",0,({events:e,className:n})=>{if(console.log("MCPEventsDisplay: Received events:",e),!e||0===e.length)return console.log("MCPEventsDisplay: No events, returning null"),null;let a=e.find(e=>"response.output_item.done"===e.type&&e.item?.type==="mcp_list_tools"&&e.item.tools&&e.item.tools.length>0),r=e.filter(e=>"response.output_item.done"===e.type&&e.item?.type==="mcp_call");return(console.log("MCPEventsDisplay: toolsEvent:",a),console.log("MCPEventsDisplay: mcpCallEvents:",r),a||0!==r.length)?(0,t.jsxs)("div",{className:`jsx-32b14b04f420f3ac mcp-events-display ${n||""}`,children:[(0,t.jsx)(o.default,{id:"32b14b04f420f3ac",children:".openai-mcp-tools.jsx-32b14b04f420f3ac{margin:0;padding:0;position:relative}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse.jsx-32b14b04f420f3ac,.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-item.jsx-32b14b04f420f3ac{background:0 0!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac{color:#9ca3af!important;background:0 0!important;border:none!important;min-height:20px!important;padding:0 0 0 20px!important;font-size:14px!important;font-weight:400!important;line-height:20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac:hover{color:#6b7280!important;background:0 0!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content.jsx-32b14b04f420f3ac{background:0 0!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content-box.jsx-32b14b04f420f3ac{padding:4px 0 0 20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac{color:#9ca3af!important;justify-content:center!important;align-items:center!important;width:16px!important;height:16px!important;font-size:10px!important;display:flex!important;position:absolute!important;top:2px!important;left:2px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac:hover{color:#6b7280!important}.openai-vertical-line.jsx-32b14b04f420f3ac{opacity:.8;background-color:#f3f4f6;width:.5px;position:absolute;top:18px;bottom:0;left:9px}.tool-item.jsx-32b14b04f420f3ac{color:#4b5563;z-index:1;background:#fff;margin:0;padding:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:18px;position:relative}.mcp-section.jsx-32b14b04f420f3ac{z-index:1;background:#fff;margin-bottom:12px;position:relative}.mcp-section.jsx-32b14b04f420f3ac:last-child{margin-bottom:0}.mcp-section-header.jsx-32b14b04f420f3ac{color:#6b7280;margin-bottom:4px;font-size:13px;font-weight:500}.mcp-code-block.jsx-32b14b04f420f3ac{background:#f9fafb;border:1px solid #f3f4f6;border-radius:6px;padding:8px;font-size:12px}.mcp-json.jsx-32b14b04f420f3ac{color:#374151;white-space:pre-wrap;word-wrap:break-word;margin:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace}.mcp-approved.jsx-32b14b04f420f3ac{color:#6b7280;align-items:center;font-size:13px;display:flex}.mcp-checkmark.jsx-32b14b04f420f3ac{color:#10b981;margin-right:6px;font-weight:700}.mcp-response-content.jsx-32b14b04f420f3ac{color:#374151;white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.5}"}),(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac openai-mcp-tools",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac openai-vertical-line"}),(0,t.jsxs)(i.Collapse,{ghost:!0,size:"small",expandIconPosition:"start",defaultActiveKey:a?["list-tools"]:r.map((e,t)=>`mcp-call-${t}`),children:[a&&(0,t.jsx)(s,{header:"List tools",children:(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac",children:a.item?.tools?.map((e,o)=>(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac tool-item",children:e.name},o))})},"list-tools"),r.map((e,o)=>(0,t.jsx)(s,{header:e.item?.name||"Tool call",children:(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac",children:[(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Request"}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-code-block",children:e.item?.arguments&&(0,t.jsx)("pre",{className:"jsx-32b14b04f420f3ac mcp-json",children:(()=>{try{return JSON.stringify(JSON.parse(e.item.arguments),null,2)}catch(t){return e.item.arguments}})()})})]}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-approved",children:[(0,t.jsx)("span",{className:"jsx-32b14b04f420f3ac mcp-checkmark",children:"✓"})," Approved"]})}),e.item?.output&&(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Response"}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-response-content",children:e.item.output})]})]})},`mcp-call-${o}`))]})]})]}):(console.log("MCPEventsDisplay: No valid events found, returning null"),null)}])},966988,e=>{"use strict";var t=e.i(843476),o=e.i(271645),n=e.i(464571),i=e.i(918789),a=e.i(650056),s=e.i(219470),r=e.i(755151),l=e.i(240647),c=e.i(812618);e.s(["default",0,({reasoningContent:e})=>{let[p,d]=(0,o.useState)(!0);return e?(0,t.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,t.jsxs)(n.Button,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>d(!p),icon:(0,t.jsx)(c.BulbOutlined,{}),children:[p?"Hide reasoning":"Show reasoning",p?(0,t.jsx)(r.DownOutlined,{className:"ml-1"}):(0,t.jsx)(l.RightOutlined,{className:"ml-1"})]}),p&&(0,t.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,t.jsx)(i.default,{components:{code({node:e,inline:o,className:n,children:i,...r}){let l=/language-(\w+)/.exec(n||"");return!o&&l?(0,t.jsx)(a.Prism,{style:s.coy,language:l[1],PreTag:"div",className:"rounded-md my-2",...r,children:String(i).replace(/\n$/,"")}):(0,t.jsx)("code",{className:`${n} px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono`,...r,children:i})}},children:e})})]}):null}])},84899,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"},i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["SendOutlined",0,a],84899)},782273,793916,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M625.9 115c-5.9 0-11.9 1.6-17.4 5.3L254 352H90c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h164l354.5 231.7c5.5 3.6 11.6 5.3 17.4 5.3 16.7 0 32.1-13.3 32.1-32.1V147.1c0-18.8-15.4-32.1-32.1-32.1zM586 803L293.4 611.7l-18-11.7H146V424h129.4l17.9-11.7L586 221v582zm348-327H806c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16h128c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16zm-41.9 261.8l-110.3-63.7a15.9 15.9 0 00-21.7 5.9l-19.9 34.5c-4.4 7.6-1.8 17.4 5.8 21.8L856.3 800a15.9 15.9 0 0021.7-5.9l19.9-34.5c4.4-7.6 1.7-17.4-5.8-21.8zM760 344a15.9 15.9 0 0021.7 5.9L892 286.2c7.6-4.4 10.2-14.2 5.8-21.8L878 230a15.9 15.9 0 00-21.7-5.9L746 287.8a15.99 15.99 0 00-5.8 21.8L760 344z"}}]},name:"sound",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["SoundOutlined",0,a],782273);let s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"}}]},name:"audio",theme:"outlined"};var r=o.forwardRef(function(e,n){return o.createElement(i.default,(0,t.default)({},e,{ref:n,icon:s}))});e.s(["AudioOutlined",0,r],793916)},190272,785913,e=>{"use strict";var t,o,n=((t={}).AUDIO_SPEECH="audio_speech",t.AUDIO_TRANSCRIPTION="audio_transcription",t.IMAGE_GENERATION="image_generation",t.VIDEO_GENERATION="video_generation",t.CHAT="chat",t.RESPONSES="responses",t.IMAGE_EDITS="image_edits",t.ANTHROPIC_MESSAGES="anthropic_messages",t.EMBEDDING="embedding",t),i=((o={}).IMAGE="image",o.VIDEO="video",o.CHAT="chat",o.RESPONSES="responses",o.IMAGE_EDITS="image_edits",o.ANTHROPIC_MESSAGES="anthropic_messages",o.EMBEDDINGS="embeddings",o.SPEECH="speech",o.TRANSCRIPTION="transcription",o.A2A_AGENTS="a2a_agents",o.MCP="mcp",o.REALTIME="realtime",o);let a={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings"};e.s(["EndpointType",()=>i,"getEndpointType",0,e=>{if(console.log("getEndpointType:",e),Object.values(n).includes(e)){let t=a[e];return console.log("endpointType:",t),t}return"chat"}],785913),e.s(["generateCodeSnippet",0,e=>{let t,{apiKeySource:o,accessToken:n,apiKey:a,inputMessage:s,chatHistory:r,selectedTags:l,selectedVectorStores:c,selectedGuardrails:p,selectedPolicies:d,selectedMCPServers:m,mcpServers:u,mcpServerToolRestrictions:f,selectedVoice:g,endpointType:h,selectedModel:_,selectedSdk:b,proxySettings:v}=e,x="session"===o?n:a,y=window.location.origin,w=v?.LITELLM_UI_API_DOC_BASE_URL;w&&w.trim()?y=w:v?.PROXY_BASE_URL&&(y=v.PROXY_BASE_URL);let j=s||"Your prompt here",S=j.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),k=r.filter(e=>!e.isImage).map(({role:e,content:t})=>({role:e,content:t})),C={};l.length>0&&(C.tags=l),c.length>0&&(C.vector_stores=c),p.length>0&&(C.guardrails=p),d.length>0&&(C.policies=d);let O=_||"your-model-name",E="azure"===b?`import openai | |||
| @@ -0,0 +1,420 @@ | |||
| (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,434166,e=>{"use strict";function t(e,t){window.sessionStorage.setItem(e,btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))))}function o(e){try{let t=window.sessionStorage.getItem(e);if(null===t)return null;return decodeURIComponent(atob(t).split("").map(e=>"%"+e.charCodeAt(0).toString(16).padStart(2,"0")).join(""))}catch{return null}}e.s(["getSecureItem",()=>o,"setSecureItem",()=>t])},596239,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["LinkOutlined",0,a],596239)},166406,e=>{"use strict";var t=e.i(190144);e.s(["CopyOutlined",()=>t.default])},240647,e=>{"use strict";var t=e.i(286612);e.s(["RightOutlined",()=>t.default])},362024,e=>{"use strict";var t=e.i(988122);e.s(["Collapse",()=>t.default])},516015,(e,t,o)=>{},898547,(e,t,o)=>{var n=e.i(247167);e.r(516015);var i=e.r(271645),a=i&&"object"==typeof i&&"default"in i?i:{default:i},s=void 0!==n.default&&n.default.env&&!0,r=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,o=t.name,n=void 0===o?"stylesheet":o,i=t.optimizeForSpeed,a=void 0===i?s:i;c(r(n),"`name` must be a string"),this._name=n,this._deletedRulePlaceholder="#"+n+"-deleted-rule____{}",c("boolean"==typeof a,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=a,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var l="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=l?l.getAttribute("content"):null}var t,o=e.prototype;return o.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},o.isOptimizeForSpeed=function(){return this._optimizeForSpeed},o.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(s||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,o){return"number"==typeof o?e._serverSheet.cssRules[o]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),o},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},o.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},o.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},o.insertRule=function(e,t){if(c(r(e),"`insertRule` accepts only strings"),"u"<typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var o=this.getSheet();"number"!=typeof t&&(t=o.cssRules.length);try{o.insertRule(e,t)}catch(t){return s||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var n=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,n))}return this._rulesCount++},o.replaceRule=function(e,t){if(this._optimizeForSpeed||"u"<typeof window){var o="u">typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!o.cssRules[e])return e;o.deleteRule(e);try{o.insertRule(t,e)}catch(n){s||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),o.insertRule(this._deletedRulePlaceholder,e)}}else{var n=this._tags[e];c(n,"old rule at index `"+e+"` not found"),n.textContent=t}return e},o.deleteRule=function(e){if("u"<typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},o.flush=function(){this._injected=!1,this._rulesCount=0,"u">typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},o.cssRules=function(){var e=this;return"u"<typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,o){return o?t=t.concat(Array.prototype.map.call(e.getSheetForTag(o).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},o.makeStyleTag=function(e,t,o){t&&c(r(t),"makeStyleTag accepts only strings as second parameter");var n=document.createElement("style");this._nonce&&n.setAttribute("nonce",this._nonce),n.type="text/css",n.setAttribute("data-"+e,""),t&&n.appendChild(document.createTextNode(t));var i=document.head||document.getElementsByTagName("head")[0];return o?i.insertBefore(n,o):i.appendChild(n),n},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var p=function(e){for(var t=5381,o=e.length;o;)t=33*t^e.charCodeAt(--o);return t>>>0},d={};function m(e,t){if(!t)return"jsx-"+e;var o=String(t),n=e+o;return d[n]||(d[n]="jsx-"+p(e+"-"+o)),d[n]}function u(e,t){"u"<typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var o=e+t;return d[o]||(d[o]=t.replace(/__jsx-style-dynamic-selector/g,e)),d[o]}var f=function(){function e(e){var t=void 0===e?{}:e,o=t.styleSheet,n=void 0===o?null:o,i=t.optimizeForSpeed,a=void 0!==i&&i;this._sheet=n||new l({name:"styled-jsx",optimizeForSpeed:a}),this._sheet.inject(),n&&"boolean"==typeof a&&(this._sheet.setOptimizeForSpeed(a),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"u">typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var o=this.getIdAndRules(e),n=o.styleId,i=o.rules;if(n in this._instancesCounts){this._instancesCounts[n]+=1;return}var a=i.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[n]=a,this._instancesCounts[n]=1},t.remove=function(e){var t=this,o=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(o in this._instancesCounts,"styleId: `"+o+"` not found"),this._instancesCounts[o]-=1,this._instancesCounts[o]<1){var n=this._fromServer&&this._fromServer[o];n?(n.parentNode.removeChild(n),delete this._fromServer[o]):(this._indices[o].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[o]),delete this._instancesCounts[o]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],o=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return o[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,o;return t=this.cssRules(),void 0===(o=e)&&(o={}),t.map(function(e){var t=e[0],n=e[1];return a.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:o.nonce?o.nonce:void 0,dangerouslySetInnerHTML:{__html:n}})})},t.getIdAndRules=function(e){var t=e.children,o=e.dynamic,n=e.id;if(o){var i=m(n,o);return{styleId:i,rules:Array.isArray(t)?t.map(function(e){return u(i,e)}):[u(i,t)]}}return{styleId:m(n),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),g=i.createContext(null);function h(){return new f}function _(){return i.useContext(g)}g.displayName="StyleSheetContext";var b=a.default.useInsertionEffect||a.default.useLayoutEffect,v="u">typeof window?h():void 0;function x(e){var t=v||_();return t&&("u"<typeof window?t.add(e):b(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}x.dynamic=function(e){return e.map(function(e){return m(e[0],e[1])}).join(" ")},o.StyleRegistry=function(e){var t=e.registry,o=e.children,n=i.useContext(g),s=i.useState(function(){return n||t||h()})[0];return a.default.createElement(g.Provider,{value:s},o)},o.createStyleRegistry=h,o.style=x,o.useStyleRegistry=_},437902,(e,t,o)=>{t.exports=e.r(898547).style},254530,452598,e=>{"use strict";e.i(247167);var t=e.i(356449),o=e.i(764205);async function n(e,n,i,a,s,r,l,c,p,d,m,u,f,g,h,_,b,v,x,y,w,j,S,k,C){console.log=function(){},console.log("isLocal:",!1);let O=y||(0,o.getProxyBaseUrl)(),E={};s&&s.length>0&&(E["x-litellm-tags"]=s.join(","));let T=new t.default.OpenAI({apiKey:a,baseURL:O,dangerouslyAllowBrowser:!0,defaultHeaders:E});try{let t,o=Date.now(),a=!1,s={},y=!1,O=[];for await(let x of(g&&g.length>0&&(g.includes("__all__")?O.push({type:"mcp",server_label:"litellm",server_url:"litellm_proxy/mcp",require_approval:"never"}):g.forEach(e=>{if(e.startsWith("toolset:")){let t=e.slice(8),o=C?.find(e=>e.toolset_id===t),n=o?.toolset_name||t;O.push({type:"mcp",server_label:n,server_url:`litellm_proxy/mcp/${encodeURIComponent(n)}`,require_approval:"never"})}else{let t=w?.find(t=>t.server_id===e),o=t?.alias||t?.server_name||e,n=j?.[e]||[];O.push({type:"mcp",server_label:"litellm",server_url:`litellm_proxy/mcp/${o}`,require_approval:"never",...n.length>0?{allowed_tools:n}:{}})}})),await T.chat.completions.create({model:i,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:d,messages:e,...m?{vector_store_ids:m}:{},...u?{guardrails:u}:{},...f?{policies:f}:{},...O.length>0?{tools:O,tool_choice:"auto"}:{},...void 0!==b?{temperature:b}:{},...void 0!==v?{max_tokens:v}:{},...k?{mock_testing_fallbacks:!0}:{}},{signal:r}))){console.log("Stream chunk:",x);let e=x.choices[0]?.delta;if(console.log("Delta content:",x.choices[0]?.delta?.content),console.log("Delta reasoning content:",e?.reasoning_content),!a&&(x.choices[0]?.delta?.content||e&&e.reasoning_content)&&(a=!0,t=Date.now()-o,console.log("First token received! Time:",t,"ms"),c?(console.log("Calling onTimingData with:",t),c(t)):console.log("onTimingData callback is not defined!")),x.choices[0]?.delta?.content){let e=x.choices[0].delta.content;n(e,x.model)}if(e&&e.image&&h&&(console.log("Image generated:",e.image),h(e.image.url,x.model)),e&&e.reasoning_content){let t=e.reasoning_content;l&&l(t)}if(e&&e.provider_specific_fields?.search_results&&_&&(console.log("Search results found:",e.provider_specific_fields.search_results),_(e.provider_specific_fields.search_results)),e&&e.provider_specific_fields){let t=e.provider_specific_fields;if(t.mcp_list_tools&&!s.mcp_list_tools&&(s.mcp_list_tools=t.mcp_list_tools,S&&!y)){y=!0;let e={type:"response.output_item.done",item_id:"mcp_list_tools",item:{type:"mcp_list_tools",tools:t.mcp_list_tools.map(e=>({name:e.function?.name||e.name||"",description:e.function?.description||e.description||"",input_schema:e.function?.parameters||e.input_schema||{}}))},timestamp:Date.now()};S(e),console.log("MCP list_tools event sent:",e)}t.mcp_tool_calls&&(s.mcp_tool_calls=t.mcp_tool_calls),t.mcp_call_results&&(s.mcp_call_results=t.mcp_call_results),(t.mcp_list_tools||t.mcp_tool_calls||t.mcp_call_results)&&console.log("MCP metadata found in chunk:",{mcp_list_tools:t.mcp_list_tools?"present":"absent",mcp_tool_calls:t.mcp_tool_calls?"present":"absent",mcp_call_results:t.mcp_call_results?"present":"absent"})}if(x.usage&&p){console.log("Usage data found:",x.usage);let e={completionTokens:x.usage.completion_tokens,promptTokens:x.usage.prompt_tokens,totalTokens:x.usage.total_tokens};x.usage.completion_tokens_details?.reasoning_tokens&&(e.reasoningTokens=x.usage.completion_tokens_details.reasoning_tokens),void 0!==x.usage.cost&&null!==x.usage.cost&&(e.cost=parseFloat(x.usage.cost)),p(e)}}S&&(s.mcp_tool_calls||s.mcp_call_results)&&s.mcp_tool_calls&&s.mcp_tool_calls.length>0&&s.mcp_tool_calls.forEach((e,t)=>{let o=e.function?.name||e.name||"",n=e.function?.arguments||e.arguments||"{}",i=s.mcp_call_results?.find(t=>t.tool_call_id===e.id||t.tool_call_id===e.call_id)||s.mcp_call_results?.[t],a={type:"response.output_item.done",item:{type:"mcp_call",name:o,arguments:"string"==typeof n?n:JSON.stringify(n),output:i?.result?"string"==typeof i.result?i.result:JSON.stringify(i.result):void 0},item_id:e.id||e.call_id,timestamp:Date.now()};S(a),console.log("MCP call event sent:",a)});let E=Date.now();x&&x(E-o)}catch(e){throw r?.aborted&&console.log("Chat completion request was cancelled"),e}}e.s(["makeOpenAIChatCompletionRequest",()=>n],254530);var i=e.i(727749);async function a(e,n,s,r,l=[],c,p,d,m,u,f,g,h,_,b,v,x,y,w,j,S,k,C){if(!r)throw Error("Virtual Key is required");if(!s||""===s.trim())throw Error("Model is required. Please select a model before sending a request.");console.log=function(){};let O=j||(0,o.getProxyBaseUrl)(),E={};l&&l.length>0&&(E["x-litellm-tags"]=l.join(","));let T=new t.default.OpenAI({apiKey:r,baseURL:O,dangerouslyAllowBrowser:!0,defaultHeaders:E});try{let t=Date.now(),o=!1,i=e.map(e=>(Array.isArray(e.content),{role:e.role,content:e.content,type:"message"})),a=[];_&&_.length>0&&(_.includes("__all__")?a.push({type:"mcp",server_label:"litellm",server_url:`${O}/mcp`,require_approval:"never"}):_.forEach(e=>{if(e.startsWith("toolset:")){let t=e.slice(8),o=C?.find(e=>e.toolset_id===t),n=o?.toolset_name||t;a.push({type:"mcp",server_label:n,server_url:`${O}/mcp/${encodeURIComponent(n)}`,require_approval:"never"})}else{let t=S?.find(t=>t.server_id===e),o=t?.server_name||e,n=k?.[e]||[];a.push({type:"mcp",server_label:o,server_url:`${O}/mcp/${encodeURIComponent(o)}`,require_approval:"never",...n.length>0?{allowed_tools:n}:{}})}})),y&&a.push({type:"code_interpreter",container:{type:"auto"}});let r=await T.responses.create({model:s,input:i,stream:!0,litellm_trace_id:u,...b?{previous_response_id:b}:{},...f?{vector_store_ids:f}:{},...g?{guardrails:g}:{},...h?{policies:h}:{},...a.length>0?{tools:a,tool_choice:"auto"}:{}},{signal:c}),l="",j={code:"",containerId:""};for await(let e of r)if(console.log("Response event:",e),"object"==typeof e&&null!==e){if((e.type?.startsWith("response.mcp_")||"response.output_item.done"===e.type&&(e.item?.type==="mcp_list_tools"||e.item?.type==="mcp_call"))&&(console.log("MCP event received:",e),x)){let t={type:e.type,sequence_number:e.sequence_number,output_index:e.output_index,item_id:e.item_id||e.item?.id,item:e.item,delta:e.delta,arguments:e.arguments,timestamp:Date.now()};x(t)}"response.output_item.done"===e.type&&e.item?.type==="mcp_call"&&e.item?.name&&(l=e.item.name,console.log("MCP tool used:",l)),z=j;var z,R=j="response.output_item.done"===e.type&&e.item?.type==="code_interpreter_call"?(console.log("Code interpreter call completed:",e.item),{code:e.item.code||"",containerId:e.item.container_id||""}):z;if("response.output_item.done"===e.type&&e.item?.type==="message"&&e.item?.content&&w){for(let t of e.item.content)if("output_text"===t.type&&t.annotations){let e=t.annotations.filter(e=>"container_file_citation"===e.type);(e.length>0||R.code)&&w({code:R.code,containerId:R.containerId,annotations:e})}}if("response.role.delta"===e.type)continue;if("response.output_text.delta"===e.type&&"string"==typeof e.delta){let i=e.delta;if(console.log("Text delta",i),i.length>0&&(n("assistant",i,s),!o)){o=!0;let e=Date.now()-t;console.log("First token received! Time:",e,"ms"),d&&d(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let t=e.delta;"string"==typeof t&&p&&p(t)}if("response.completed"===e.type&&"response"in e){let t=e.response,o=t.usage;if(console.log("Usage data:",o),console.log("Response completed event:",t),t.id&&v&&(console.log("Response ID for session management:",t.id),v(t.id)),o&&m){console.log("Usage data:",o);let e={completionTokens:o.output_tokens,promptTokens:o.input_tokens,totalTokens:o.total_tokens};o.completion_tokens_details?.reasoning_tokens&&(e.reasoningTokens=o.completion_tokens_details.reasoning_tokens),m(e,l)}}}return r}catch(e){throw c?.aborted?console.log("Responses API request was cancelled"):i.default.fromBackend(`Error occurred while generating model response. Please try again. Error: ${e}`),e}}e.s(["makeOpenAIResponsesRequest",()=>a],452598)},355343,e=>{"use strict";var t=e.i(843476),o=e.i(437902),n=e.i(898586),i=e.i(362024);let{Text:a}=n.Typography,{Panel:s}=i.Collapse;e.s(["default",0,({events:e,className:n})=>{if(console.log("MCPEventsDisplay: Received events:",e),!e||0===e.length)return console.log("MCPEventsDisplay: No events, returning null"),null;let a=e.find(e=>"response.output_item.done"===e.type&&e.item?.type==="mcp_list_tools"&&e.item.tools&&e.item.tools.length>0),r=e.filter(e=>"response.output_item.done"===e.type&&e.item?.type==="mcp_call");return(console.log("MCPEventsDisplay: toolsEvent:",a),console.log("MCPEventsDisplay: mcpCallEvents:",r),a||0!==r.length)?(0,t.jsxs)("div",{className:`jsx-32b14b04f420f3ac mcp-events-display ${n||""}`,children:[(0,t.jsx)(o.default,{id:"32b14b04f420f3ac",children:".openai-mcp-tools.jsx-32b14b04f420f3ac{margin:0;padding:0;position:relative}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse.jsx-32b14b04f420f3ac,.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-item.jsx-32b14b04f420f3ac{background:0 0!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac{color:#9ca3af!important;background:0 0!important;border:none!important;min-height:20px!important;padding:0 0 0 20px!important;font-size:14px!important;font-weight:400!important;line-height:20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac:hover{color:#6b7280!important;background:0 0!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content.jsx-32b14b04f420f3ac{background:0 0!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content-box.jsx-32b14b04f420f3ac{padding:4px 0 0 20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac{color:#9ca3af!important;justify-content:center!important;align-items:center!important;width:16px!important;height:16px!important;font-size:10px!important;display:flex!important;position:absolute!important;top:2px!important;left:2px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac:hover{color:#6b7280!important}.openai-vertical-line.jsx-32b14b04f420f3ac{opacity:.8;background-color:#f3f4f6;width:.5px;position:absolute;top:18px;bottom:0;left:9px}.tool-item.jsx-32b14b04f420f3ac{color:#4b5563;z-index:1;background:#fff;margin:0;padding:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:18px;position:relative}.mcp-section.jsx-32b14b04f420f3ac{z-index:1;background:#fff;margin-bottom:12px;position:relative}.mcp-section.jsx-32b14b04f420f3ac:last-child{margin-bottom:0}.mcp-section-header.jsx-32b14b04f420f3ac{color:#6b7280;margin-bottom:4px;font-size:13px;font-weight:500}.mcp-code-block.jsx-32b14b04f420f3ac{background:#f9fafb;border:1px solid #f3f4f6;border-radius:6px;padding:8px;font-size:12px}.mcp-json.jsx-32b14b04f420f3ac{color:#374151;white-space:pre-wrap;word-wrap:break-word;margin:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace}.mcp-approved.jsx-32b14b04f420f3ac{color:#6b7280;align-items:center;font-size:13px;display:flex}.mcp-checkmark.jsx-32b14b04f420f3ac{color:#10b981;margin-right:6px;font-weight:700}.mcp-response-content.jsx-32b14b04f420f3ac{color:#374151;white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.5}"}),(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac openai-mcp-tools",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac openai-vertical-line"}),(0,t.jsxs)(i.Collapse,{ghost:!0,size:"small",expandIconPosition:"start",defaultActiveKey:a?["list-tools"]:r.map((e,t)=>`mcp-call-${t}`),children:[a&&(0,t.jsx)(s,{header:"List tools",children:(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac",children:a.item?.tools?.map((e,o)=>(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac tool-item",children:e.name},o))})},"list-tools"),r.map((e,o)=>(0,t.jsx)(s,{header:e.item?.name||"Tool call",children:(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac",children:[(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Request"}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-code-block",children:e.item?.arguments&&(0,t.jsx)("pre",{className:"jsx-32b14b04f420f3ac mcp-json",children:(()=>{try{return JSON.stringify(JSON.parse(e.item.arguments),null,2)}catch(t){return e.item.arguments}})()})})]}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-approved",children:[(0,t.jsx)("span",{className:"jsx-32b14b04f420f3ac mcp-checkmark",children:"✓"})," Approved"]})}),e.item?.output&&(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Response"}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-response-content",children:e.item.output})]})]})},`mcp-call-${o}`))]})]})]}):(console.log("MCPEventsDisplay: No valid events found, returning null"),null)}])},966988,e=>{"use strict";var t=e.i(843476),o=e.i(271645),n=e.i(464571),i=e.i(918789),a=e.i(650056),s=e.i(219470),r=e.i(755151),l=e.i(240647),c=e.i(812618);e.s(["default",0,({reasoningContent:e})=>{let[p,d]=(0,o.useState)(!0);return e?(0,t.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,t.jsxs)(n.Button,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>d(!p),icon:(0,t.jsx)(c.BulbOutlined,{}),children:[p?"Hide reasoning":"Show reasoning",p?(0,t.jsx)(r.DownOutlined,{className:"ml-1"}):(0,t.jsx)(l.RightOutlined,{className:"ml-1"})]}),p&&(0,t.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,t.jsx)(i.default,{components:{code({node:e,inline:o,className:n,children:i,...r}){let l=/language-(\w+)/.exec(n||"");return!o&&l?(0,t.jsx)(a.Prism,{style:s.coy,language:l[1],PreTag:"div",className:"rounded-md my-2",...r,children:String(i).replace(/\n$/,"")}):(0,t.jsx)("code",{className:`${n} px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono`,...r,children:i})}},children:e})})]}):null}])},84899,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"},i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["SendOutlined",0,a],84899)},782273,793916,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M625.9 115c-5.9 0-11.9 1.6-17.4 5.3L254 352H90c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h164l354.5 231.7c5.5 3.6 11.6 5.3 17.4 5.3 16.7 0 32.1-13.3 32.1-32.1V147.1c0-18.8-15.4-32.1-32.1-32.1zM586 803L293.4 611.7l-18-11.7H146V424h129.4l17.9-11.7L586 221v582zm348-327H806c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16h128c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16zm-41.9 261.8l-110.3-63.7a15.9 15.9 0 00-21.7 5.9l-19.9 34.5c-4.4 7.6-1.8 17.4 5.8 21.8L856.3 800a15.9 15.9 0 0021.7-5.9l19.9-34.5c4.4-7.6 1.7-17.4-5.8-21.8zM760 344a15.9 15.9 0 0021.7 5.9L892 286.2c7.6-4.4 10.2-14.2 5.8-21.8L878 230a15.9 15.9 0 00-21.7-5.9L746 287.8a15.99 15.99 0 00-5.8 21.8L760 344z"}}]},name:"sound",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["SoundOutlined",0,a],782273);let s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"}}]},name:"audio",theme:"outlined"};var r=o.forwardRef(function(e,n){return o.createElement(i.default,(0,t.default)({},e,{ref:n,icon:s}))});e.s(["AudioOutlined",0,r],793916)},190272,785913,e=>{"use strict";var t,o,n=((t={}).AUDIO_SPEECH="audio_speech",t.AUDIO_TRANSCRIPTION="audio_transcription",t.IMAGE_GENERATION="image_generation",t.VIDEO_GENERATION="video_generation",t.CHAT="chat",t.RESPONSES="responses",t.IMAGE_EDITS="image_edits",t.ANTHROPIC_MESSAGES="anthropic_messages",t.EMBEDDING="embedding",t),i=((o={}).IMAGE="image",o.VIDEO="video",o.CHAT="chat",o.RESPONSES="responses",o.IMAGE_EDITS="image_edits",o.ANTHROPIC_MESSAGES="anthropic_messages",o.EMBEDDINGS="embeddings",o.SPEECH="speech",o.TRANSCRIPTION="transcription",o.A2A_AGENTS="a2a_agents",o.MCP="mcp",o.REALTIME="realtime",o);let a={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings"};e.s(["EndpointType",()=>i,"getEndpointType",0,e=>{if(console.log("getEndpointType:",e),Object.values(n).includes(e)){let t=a[e];return console.log("endpointType:",t),t}return"chat"}],785913),e.s(["generateCodeSnippet",0,e=>{let t,{apiKeySource:o,accessToken:n,apiKey:a,inputMessage:s,chatHistory:r,selectedTags:l,selectedVectorStores:c,selectedGuardrails:p,selectedPolicies:d,selectedMCPServers:m,mcpServers:u,mcpServerToolRestrictions:f,selectedVoice:g,endpointType:h,selectedModel:_,selectedSdk:b,proxySettings:v}=e,x="session"===o?n:a,y=window.location.origin,w=v?.LITELLM_UI_API_DOC_BASE_URL;w&&w.trim()?y=w:v?.PROXY_BASE_URL&&(y=v.PROXY_BASE_URL);let j=s||"Your prompt here",S=j.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),k=r.filter(e=>!e.isImage).map(({role:e,content:t})=>({role:e,content:t})),C={};l.length>0&&(C.tags=l),c.length>0&&(C.vector_stores=c),p.length>0&&(C.guardrails=p),d.length>0&&(C.policies=d);let O=_||"your-model-name",E="azure"===b?`import openai | |||
| # ) | ||
| # response.stream_to_file("output_speech.mp3") | ||
| `;break;default:t="\n# Code generation for this endpoint is not implemented yet."}return`${E} | ||
| ${t}`}],190272)},518617,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["CloseCircleOutlined",0,a],518617)},245704,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["CheckCircleOutlined",0,a],245704)},245094,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["CodeOutlined",0,a],245094)},829672,836938,310730,e=>{"use strict";e.i(247167);var t=e.i(271645),o=e.i(343794),n=e.i(914949),i=e.i(404948);let a=e=>e?"function"==typeof e?e():e:null;e.s(["getRenderPropValue",0,a],836938);var s=e.i(613541),r=e.i(763731),l=e.i(242064),c=e.i(491816);e.i(793154);var p=e.i(880476),d=e.i(183293),m=e.i(717356),u=e.i(320560),f=e.i(307358),g=e.i(246422),h=e.i(838378),_=e.i(617933);let b=(0,g.genStyleHooks)("Popover",e=>{let{colorBgElevated:t,colorText:o}=e,n=(0,h.mergeToken)(e,{popoverBg:t,popoverColor:o});return[(e=>{let{componentCls:t,popoverColor:o,titleMinWidth:n,fontWeightStrong:i,innerPadding:a,boxShadowSecondary:s,colorTextHeading:r,borderRadiusLG:l,zIndexPopup:c,titleMarginBottom:p,colorBgElevated:m,popoverBg:f,titleBorderBottom:g,innerContentPadding:h,titlePadding:_}=e;return[{[t]:Object.assign(Object.assign({},(0,d.resetComponent)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:c,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:"var(--valid-offset-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":m,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-inner`]:{backgroundColor:f,backgroundClip:"padding-box",borderRadius:l,boxShadow:s,padding:a},[`${t}-title`]:{minWidth:n,marginBottom:p,color:r,fontWeight:i,borderBottom:g,padding:_},[`${t}-inner-content`]:{color:o,padding:h}})},(0,u.default)(e,"var(--antd-arrow-background-color)"),{[`${t}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",[`${t}-content`]:{display:"inline-block"}}}]})(n),(e=>{let{componentCls:t}=e;return{[t]:_.PresetColors.map(o=>{let n=e[`${o}6`];return{[`&${t}-${o}`]:{"--antd-arrow-background-color":n,[`${t}-inner`]:{backgroundColor:n},[`${t}-arrow`]:{background:"transparent"}}}})}})(n),(0,m.initZoomMotion)(n,"zoom-big")]},e=>{let{lineWidth:t,controlHeight:o,fontHeight:n,padding:i,wireframe:a,zIndexPopupBase:s,borderRadiusLG:r,marginXS:l,lineType:c,colorSplit:p,paddingSM:d}=e,m=o-n;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:s+30},(0,f.getArrowToken)(e)),(0,u.getArrowOffsetToken)({contentRadius:r,limitVerticalRadius:!0})),{innerPadding:12*!a,titleMarginBottom:a?0:l,titlePadding:a?`${m/2}px ${i}px ${m/2-t}px`:0,titleBorderBottom:a?`${t}px ${c} ${p}`:"none",innerContentPadding:a?`${d}px ${i}px`:0})},{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]});var v=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(o[n[i]]=e[n[i]]);return o};let x=({title:e,content:o,prefixCls:n})=>e||o?t.createElement(t.Fragment,null,e&&t.createElement("div",{className:`${n}-title`},e),o&&t.createElement("div",{className:`${n}-inner-content`},o)):null,y=e=>{let{hashId:n,prefixCls:i,className:s,style:r,placement:l="top",title:c,content:d,children:m}=e,u=a(c),f=a(d),g=(0,o.default)(n,i,`${i}-pure`,`${i}-placement-${l}`,s);return t.createElement("div",{className:g,style:r},t.createElement("div",{className:`${i}-arrow`}),t.createElement(p.Popup,Object.assign({},e,{className:n,prefixCls:i}),m||t.createElement(x,{prefixCls:i,title:u,content:f})))},w=e=>{let{prefixCls:n,className:i}=e,a=v(e,["prefixCls","className"]),{getPrefixCls:s}=t.useContext(l.ConfigContext),r=s("popover",n),[c,p,d]=b(r);return c(t.createElement(y,Object.assign({},a,{prefixCls:r,hashId:p,className:(0,o.default)(i,d)})))};e.s(["Overlay",0,x,"default",0,w],310730);var j=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(o[n[i]]=e[n[i]]);return o};let S=t.forwardRef((e,p)=>{var d,m;let{prefixCls:u,title:f,content:g,overlayClassName:h,placement:_="top",trigger:v="hover",children:y,mouseEnterDelay:w=.1,mouseLeaveDelay:S=.1,onOpenChange:k,overlayStyle:C={},styles:O,classNames:E}=e,T=j(e,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle","styles","classNames"]),{getPrefixCls:z,className:R,style:I,classNames:N,styles:M}=(0,l.useComponentConfig)("popover"),A=z("popover",u),[$,P,L]=b(A),F=z(),H=(0,o.default)(h,P,L,R,N.root,null==E?void 0:E.root),D=(0,o.default)(N.body,null==E?void 0:E.body),[B,V]=(0,n.default)(!1,{value:null!=(d=e.open)?d:e.visible,defaultValue:null!=(m=e.defaultOpen)?m:e.defaultVisible}),q=(e,t)=>{V(e,!0),null==k||k(e,t)},U=a(f),W=a(g);return $(t.createElement(c.default,Object.assign({placement:_,trigger:v,mouseEnterDelay:w,mouseLeaveDelay:S},T,{prefixCls:A,classNames:{root:H,body:D},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},M.root),I),C),null==O?void 0:O.root),body:Object.assign(Object.assign({},M.body),null==O?void 0:O.body)},ref:p,open:B,onOpenChange:e=>{q(e)},overlay:U||W?t.createElement(x,{prefixCls:A,title:U,content:W}):null,transitionName:(0,s.getTransitionName)(F,"zoom-big",T.transitionName),"data-popover-inject":!0}),(0,r.cloneElement)(y,{onKeyDown:e=>{var o,n;(0,t.isValidElement)(y)&&(null==(n=null==y?void 0:(o=y.props).onKeyDown)||n.call(o,e)),e.keyCode===i.default.ESC&&q(!1,e)}})))});S._InternalPanelDoNotUseOrYouWillBeFired=w,e.s(["default",0,S],829672)},282786,e=>{"use strict";var t=e.i(829672);e.s(["Popover",()=>t.default])},219470,812618,e=>{"use strict";e.s(["coy",0,{'code[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",maxHeight:"inherit",height:"inherit",padding:"0 1em",display:"block",overflow:"auto"},'pre[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",position:"relative",margin:".5em 0",overflow:"visible",padding:"1px",backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em"},'pre[class*="language-"] > code':{position:"relative",zIndex:"1",borderLeft:"10px solid #358ccb",boxShadow:"-1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf",backgroundColor:"#fdfdfd",backgroundImage:"linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%)",backgroundSize:"3em 3em",backgroundOrigin:"content-box",backgroundAttachment:"local"},':not(pre) > code[class*="language-"]':{backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em",position:"relative",padding:".2em",borderRadius:"0.3em",color:"#c92c2c",border:"1px solid rgba(0, 0, 0, 0.1)",display:"inline",whiteSpace:"normal"},'pre[class*="language-"]:before':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"0.18em",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(-2deg)",MozTransform:"rotate(-2deg)",msTransform:"rotate(-2deg)",OTransform:"rotate(-2deg)",transform:"rotate(-2deg)"},'pre[class*="language-"]:after':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"auto",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(2deg)",MozTransform:"rotate(2deg)",msTransform:"rotate(2deg)",OTransform:"rotate(2deg)",transform:"rotate(2deg)",right:"0.75em"},comment:{color:"#7D8B99"},"block-comment":{color:"#7D8B99"},prolog:{color:"#7D8B99"},doctype:{color:"#7D8B99"},cdata:{color:"#7D8B99"},punctuation:{color:"#5F6364"},property:{color:"#c92c2c"},tag:{color:"#c92c2c"},boolean:{color:"#c92c2c"},number:{color:"#c92c2c"},"function-name":{color:"#c92c2c"},constant:{color:"#c92c2c"},symbol:{color:"#c92c2c"},deleted:{color:"#c92c2c"},selector:{color:"#2f9c0a"},"attr-name":{color:"#2f9c0a"},string:{color:"#2f9c0a"},char:{color:"#2f9c0a"},function:{color:"#2f9c0a"},builtin:{color:"#2f9c0a"},inserted:{color:"#2f9c0a"},operator:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},entity:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)",cursor:"help"},url:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},variable:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},atrule:{color:"#1990b8"},"attr-value":{color:"#1990b8"},keyword:{color:"#1990b8"},"class-name":{color:"#1990b8"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"normal"},".language-css .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},".style .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:".7"},'pre[class*="language-"].line-numbers.line-numbers':{paddingLeft:"0"},'pre[class*="language-"].line-numbers.line-numbers code':{paddingLeft:"3.8em"},'pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows':{left:"0"},'pre[class*="language-"][data-line]':{paddingTop:"0",paddingBottom:"0",paddingLeft:"0"},"pre[data-line] code":{position:"relative",paddingLeft:"4em"},"pre .line-highlight":{marginTop:"0"}}],219470),e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["BulbOutlined",0,a],812618)},132104,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 545.5L536.1 163a31.96 31.96 0 00-48.3 0L156 545.5a7.97 7.97 0 006 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2z"}}]},name:"arrow-up",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["ArrowUpOutlined",0,a],132104)},447593,989022,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["ClearOutlined",0,a],447593);var s=e.i(843476),r=e.i(592968),l=e.i(637235);let c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 394c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H400V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v236H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h228v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h164c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V394h164zM628 630H400V394h228v236z"}}]},name:"number",theme:"outlined"};var p=o.forwardRef(function(e,n){return o.createElement(i.default,(0,t.default)({},e,{ref:n,icon:c}))});let d={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"};var m=o.forwardRef(function(e,n){return o.createElement(i.default,(0,t.default)({},e,{ref:n,icon:d}))}),u=e.i(872934),f=e.i(812618),g=e.i(366308),h=e.i(458505);e.s(["default",0,({timeToFirstToken:e,totalLatency:t,usage:o,toolName:n})=>e||t||o?(0,s.jsxs)("div",{className:"response-metrics mt-2 pt-2 border-t border-gray-100 text-xs text-gray-500 flex flex-wrap gap-3",children:[void 0!==e&&(0,s.jsx)(r.Tooltip,{title:"Time to first token",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(l.ClockCircleOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["TTFT: ",(e/1e3).toFixed(2),"s"]})]})}),void 0!==t&&(0,s.jsx)(r.Tooltip,{title:"Total latency",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(l.ClockCircleOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["Total Latency: ",(t/1e3).toFixed(2),"s"]})]})}),o?.promptTokens!==void 0&&(0,s.jsx)(r.Tooltip,{title:"Prompt tokens",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(m,{className:"mr-1"}),(0,s.jsxs)("span",{children:["In: ",o.promptTokens]})]})}),o?.completionTokens!==void 0&&(0,s.jsx)(r.Tooltip,{title:"Completion tokens",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(u.ExportOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["Out: ",o.completionTokens]})]})}),o?.reasoningTokens!==void 0&&(0,s.jsx)(r.Tooltip,{title:"Reasoning tokens",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(f.BulbOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["Reasoning: ",o.reasoningTokens]})]})}),o?.totalTokens!==void 0&&(0,s.jsx)(r.Tooltip,{title:"Total tokens",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(p,{className:"mr-1"}),(0,s.jsxs)("span",{children:["Total: ",o.totalTokens]})]})}),o?.cost!==void 0&&(0,s.jsx)(r.Tooltip,{title:"Cost",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(h.DollarOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["$",o.cost.toFixed(6)]})]})}),n&&(0,s.jsx)(r.Tooltip,{title:"Tool used",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(g.ToolOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["Tool: ",n]})]})})]}):null],989022)}]); |
| # ) | ||
| # response.stream_to_file("output_speech.mp3") | ||
| `;break;default:t="\n# Code generation for this endpoint is not implemented yet."}return`${E} | ||
| ${t}`}],190272)},518617,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["CloseCircleOutlined",0,a],518617)},245704,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["CheckCircleOutlined",0,a],245704)},245094,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["CodeOutlined",0,a],245094)},829672,836938,310730,e=>{"use strict";e.i(247167);var t=e.i(271645),o=e.i(343794),n=e.i(914949),i=e.i(404948);let a=e=>e?"function"==typeof e?e():e:null;e.s(["getRenderPropValue",0,a],836938);var s=e.i(613541),r=e.i(763731),l=e.i(242064),c=e.i(491816);e.i(793154);var p=e.i(880476),d=e.i(183293),m=e.i(717356),u=e.i(320560),f=e.i(307358),g=e.i(246422),h=e.i(838378),_=e.i(617933);let b=(0,g.genStyleHooks)("Popover",e=>{let{colorBgElevated:t,colorText:o}=e,n=(0,h.mergeToken)(e,{popoverBg:t,popoverColor:o});return[(e=>{let{componentCls:t,popoverColor:o,titleMinWidth:n,fontWeightStrong:i,innerPadding:a,boxShadowSecondary:s,colorTextHeading:r,borderRadiusLG:l,zIndexPopup:c,titleMarginBottom:p,colorBgElevated:m,popoverBg:f,titleBorderBottom:g,innerContentPadding:h,titlePadding:_}=e;return[{[t]:Object.assign(Object.assign({},(0,d.resetComponent)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:c,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:"var(--valid-offset-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":m,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-inner`]:{backgroundColor:f,backgroundClip:"padding-box",borderRadius:l,boxShadow:s,padding:a},[`${t}-title`]:{minWidth:n,marginBottom:p,color:r,fontWeight:i,borderBottom:g,padding:_},[`${t}-inner-content`]:{color:o,padding:h}})},(0,u.default)(e,"var(--antd-arrow-background-color)"),{[`${t}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",[`${t}-content`]:{display:"inline-block"}}}]})(n),(e=>{let{componentCls:t}=e;return{[t]:_.PresetColors.map(o=>{let n=e[`${o}6`];return{[`&${t}-${o}`]:{"--antd-arrow-background-color":n,[`${t}-inner`]:{backgroundColor:n},[`${t}-arrow`]:{background:"transparent"}}}})}})(n),(0,m.initZoomMotion)(n,"zoom-big")]},e=>{let{lineWidth:t,controlHeight:o,fontHeight:n,padding:i,wireframe:a,zIndexPopupBase:s,borderRadiusLG:r,marginXS:l,lineType:c,colorSplit:p,paddingSM:d}=e,m=o-n;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:s+30},(0,f.getArrowToken)(e)),(0,u.getArrowOffsetToken)({contentRadius:r,limitVerticalRadius:!0})),{innerPadding:12*!a,titleMarginBottom:a?0:l,titlePadding:a?`${m/2}px ${i}px ${m/2-t}px`:0,titleBorderBottom:a?`${t}px ${c} ${p}`:"none",innerContentPadding:a?`${d}px ${i}px`:0})},{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]});var v=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(o[n[i]]=e[n[i]]);return o};let x=({title:e,content:o,prefixCls:n})=>e||o?t.createElement(t.Fragment,null,e&&t.createElement("div",{className:`${n}-title`},e),o&&t.createElement("div",{className:`${n}-inner-content`},o)):null,y=e=>{let{hashId:n,prefixCls:i,className:s,style:r,placement:l="top",title:c,content:d,children:m}=e,u=a(c),f=a(d),g=(0,o.default)(n,i,`${i}-pure`,`${i}-placement-${l}`,s);return t.createElement("div",{className:g,style:r},t.createElement("div",{className:`${i}-arrow`}),t.createElement(p.Popup,Object.assign({},e,{className:n,prefixCls:i}),m||t.createElement(x,{prefixCls:i,title:u,content:f})))},w=e=>{let{prefixCls:n,className:i}=e,a=v(e,["prefixCls","className"]),{getPrefixCls:s}=t.useContext(l.ConfigContext),r=s("popover",n),[c,p,d]=b(r);return c(t.createElement(y,Object.assign({},a,{prefixCls:r,hashId:p,className:(0,o.default)(i,d)})))};e.s(["Overlay",0,x,"default",0,w],310730);var j=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(o[n[i]]=e[n[i]]);return o};let S=t.forwardRef((e,p)=>{var d,m;let{prefixCls:u,title:f,content:g,overlayClassName:h,placement:_="top",trigger:v="hover",children:y,mouseEnterDelay:w=.1,mouseLeaveDelay:S=.1,onOpenChange:k,overlayStyle:C={},styles:O,classNames:E}=e,T=j(e,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle","styles","classNames"]),{getPrefixCls:z,className:R,style:I,classNames:N,styles:M}=(0,l.useComponentConfig)("popover"),A=z("popover",u),[$,P,L]=b(A),F=z(),H=(0,o.default)(h,P,L,R,N.root,null==E?void 0:E.root),D=(0,o.default)(N.body,null==E?void 0:E.body),[B,V]=(0,n.default)(!1,{value:null!=(d=e.open)?d:e.visible,defaultValue:null!=(m=e.defaultOpen)?m:e.defaultVisible}),q=(e,t)=>{V(e,!0),null==k||k(e,t)},U=a(f),W=a(g);return $(t.createElement(c.default,Object.assign({placement:_,trigger:v,mouseEnterDelay:w,mouseLeaveDelay:S},T,{prefixCls:A,classNames:{root:H,body:D},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},M.root),I),C),null==O?void 0:O.root),body:Object.assign(Object.assign({},M.body),null==O?void 0:O.body)},ref:p,open:B,onOpenChange:e=>{q(e)},overlay:U||W?t.createElement(x,{prefixCls:A,title:U,content:W}):null,transitionName:(0,s.getTransitionName)(F,"zoom-big",T.transitionName),"data-popover-inject":!0}),(0,r.cloneElement)(y,{onKeyDown:e=>{var o,n;(0,t.isValidElement)(y)&&(null==(n=null==y?void 0:(o=y.props).onKeyDown)||n.call(o,e)),e.keyCode===i.default.ESC&&q(!1,e)}})))});S._InternalPanelDoNotUseOrYouWillBeFired=w,e.s(["default",0,S],829672)},282786,e=>{"use strict";var t=e.i(829672);e.s(["Popover",()=>t.default])},219470,812618,e=>{"use strict";e.s(["coy",0,{'code[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",maxHeight:"inherit",height:"inherit",padding:"0 1em",display:"block",overflow:"auto"},'pre[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",position:"relative",margin:".5em 0",overflow:"visible",padding:"1px",backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em"},'pre[class*="language-"] > code':{position:"relative",zIndex:"1",borderLeft:"10px solid #358ccb",boxShadow:"-1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf",backgroundColor:"#fdfdfd",backgroundImage:"linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%)",backgroundSize:"3em 3em",backgroundOrigin:"content-box",backgroundAttachment:"local"},':not(pre) > code[class*="language-"]':{backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em",position:"relative",padding:".2em",borderRadius:"0.3em",color:"#c92c2c",border:"1px solid rgba(0, 0, 0, 0.1)",display:"inline",whiteSpace:"normal"},'pre[class*="language-"]:before':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"0.18em",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(-2deg)",MozTransform:"rotate(-2deg)",msTransform:"rotate(-2deg)",OTransform:"rotate(-2deg)",transform:"rotate(-2deg)"},'pre[class*="language-"]:after':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"auto",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(2deg)",MozTransform:"rotate(2deg)",msTransform:"rotate(2deg)",OTransform:"rotate(2deg)",transform:"rotate(2deg)",right:"0.75em"},comment:{color:"#7D8B99"},"block-comment":{color:"#7D8B99"},prolog:{color:"#7D8B99"},doctype:{color:"#7D8B99"},cdata:{color:"#7D8B99"},punctuation:{color:"#5F6364"},property:{color:"#c92c2c"},tag:{color:"#c92c2c"},boolean:{color:"#c92c2c"},number:{color:"#c92c2c"},"function-name":{color:"#c92c2c"},constant:{color:"#c92c2c"},symbol:{color:"#c92c2c"},deleted:{color:"#c92c2c"},selector:{color:"#2f9c0a"},"attr-name":{color:"#2f9c0a"},string:{color:"#2f9c0a"},char:{color:"#2f9c0a"},function:{color:"#2f9c0a"},builtin:{color:"#2f9c0a"},inserted:{color:"#2f9c0a"},operator:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},entity:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)",cursor:"help"},url:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},variable:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},atrule:{color:"#1990b8"},"attr-value":{color:"#1990b8"},keyword:{color:"#1990b8"},"class-name":{color:"#1990b8"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"normal"},".language-css .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},".style .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:".7"},'pre[class*="language-"].line-numbers.line-numbers':{paddingLeft:"0"},'pre[class*="language-"].line-numbers.line-numbers code':{paddingLeft:"3.8em"},'pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows':{left:"0"},'pre[class*="language-"][data-line]':{paddingTop:"0",paddingBottom:"0",paddingLeft:"0"},"pre[data-line] code":{position:"relative",paddingLeft:"4em"},"pre .line-highlight":{marginTop:"0"}}],219470),e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["BulbOutlined",0,a],812618)},132104,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 545.5L536.1 163a31.96 31.96 0 00-48.3 0L156 545.5a7.97 7.97 0 006 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2z"}}]},name:"arrow-up",theme:"outlined"};var i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["ArrowUpOutlined",0,a],132104)},447593,989022,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},i=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(i.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["ClearOutlined",0,a],447593);var s=e.i(843476),r=e.i(592968),l=e.i(637235);let c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 394c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H400V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v236H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h228v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h164c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V394h164zM628 630H400V394h228v236z"}}]},name:"number",theme:"outlined"};var p=o.forwardRef(function(e,n){return o.createElement(i.default,(0,t.default)({},e,{ref:n,icon:c}))});let d={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"};var m=o.forwardRef(function(e,n){return o.createElement(i.default,(0,t.default)({},e,{ref:n,icon:d}))}),u=e.i(872934),f=e.i(812618),g=e.i(366308),h=e.i(458505);e.s(["default",0,({timeToFirstToken:e,totalLatency:t,usage:o,toolName:n})=>e||t||o?(0,s.jsxs)("div",{className:"response-metrics mt-2 pt-2 border-t border-gray-100 text-xs text-gray-500 flex flex-wrap gap-3",children:[void 0!==e&&(0,s.jsx)(r.Tooltip,{title:"Time to first token",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(l.ClockCircleOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["TTFT: ",(e/1e3).toFixed(2),"s"]})]})}),void 0!==t&&(0,s.jsx)(r.Tooltip,{title:"Total latency",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(l.ClockCircleOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["Total Latency: ",(t/1e3).toFixed(2),"s"]})]})}),o?.promptTokens!==void 0&&(0,s.jsx)(r.Tooltip,{title:"Prompt tokens",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(m,{className:"mr-1"}),(0,s.jsxs)("span",{children:["In: ",o.promptTokens]})]})}),o?.completionTokens!==void 0&&(0,s.jsx)(r.Tooltip,{title:"Completion tokens",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(u.ExportOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["Out: ",o.completionTokens]})]})}),o?.reasoningTokens!==void 0&&(0,s.jsx)(r.Tooltip,{title:"Reasoning tokens",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(f.BulbOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["Reasoning: ",o.reasoningTokens]})]})}),o?.totalTokens!==void 0&&(0,s.jsx)(r.Tooltip,{title:"Total tokens",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(p,{className:"mr-1"}),(0,s.jsxs)("span",{children:["Total: ",o.totalTokens]})]})}),o?.cost!==void 0&&(0,s.jsx)(r.Tooltip,{title:"Cost",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(h.DollarOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["$",o.cost.toFixed(6)]})]})}),n&&(0,s.jsx)(r.Tooltip,{title:"Tool used",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(g.ToolOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["Tool: ",n]})]})})]}):null],989022)}]); |
|
|
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/test_litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewDelays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
CI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Screenshots / Proof of Fix
Type
🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test
Changes