Autogen supports a concept of config\_list which allows definitions of the LLM provider and model to be used. Portkey seamlessly integrates into the Autogen framework through a custom config we create.
from autogen import AssistantAgent, UserProxyAgent, config_list_from_json# Import the portkey library to fetch helper functionsfrom portkey_ai import PORTKEY_GATEWAY_URL, createHeadersconfig_list = [ { "api_key": 'Your OpenAI Key', "model": "gpt-3.5-turbo", "base_url": PORTKEY_GATEWAY_URL, "api_type": "openai", "default_headers": createHeaders( api_key = "Your Portkey API Key", provider = "openai", ) }]assistant = AssistantAgent("assistant", llm_config={"config_list": config_list})user_proxy = UserProxyAgent("user_proxy", code_execution_config={"work_dir": "coding", "use_docker": False}) # IMPORTANT: set to True to run code in docker, recommendeduser_proxy.initiate_chat(assistant, message="Say this is also a test - part 2.")# This initiates an automated chat between the two agents to solve the task
Notice that we updated the base_url to Portkey’s AI Gateway and then added default_headers to enable Portkey specific features.When we execute this script, it would yield the same results as without Portkey, but every request can now be inspected in the Portkey Analytics & Logs UI - including token, cost, accuracy calculations.
All the config parameters supported in Portkey are available for use as part of the headers. Let’s look at some examples:
Since Portkey seamlessly connects to 150+ models across providers, you can easily connect any of these to now run with Autogen.Let’s see an example using Mistral-7B on Anyscale running with Autogen seamlessly:
from autogen import AssistantAgent, UserProxyAgent, config_list_from_json# Import the portkey library to fetch helper functionsfrom portkey_ai import PORTKEY_GATEWAY_URL, createHeadersconfig_list = [ { "api_key": 'Your Anyscale API Key', "model": "mistralai/Mistral-7B-Instruct-v0.1", "base_url": PORTKEY_GATEWAY_URL, "api_type": "openai", # Portkey conforms to the openai api_type "default_headers": createHeaders( api_key = "Your Portkey API Key", provider = "anyscale", ) }]assistant = AssistantAgent("assistant", llm_config={"config_list": config_list})user_proxy = UserProxyAgent("user_proxy", code_execution_config={"work_dir": "coding", "use_docker": False}) # IMPORTANT: set to True to run code in docker, recommendeduser_proxy.initiate_chat(assistant, message="Say this is also a test - part 2.")# This initiates an automated chat between the two agents to solve the task
Virtual keys in Portkey allow you to easily switch between providers without manually having to store and change their API keys. Let’s use the same Mistral example above, but this time using a Virtual Key.
from autogen import AssistantAgent, UserProxyAgent, config_list_from_json# Import the portkey library to fetch helper functionsfrom portkey_ai import PORTKEY_GATEWAY_URL, createHeadersconfig_list = [ { # Set a dummy value, since we'll pick the API key from the virtual key "api_key": 'X', # Pick the model from the provider of your choice "model": "mistralai/Mistral-7B-Instruct-v0.1", "base_url": PORTKEY_GATEWAY_URL, "api_type": "openai", # Portkey conforms to the openai api_type "default_headers": createHeaders( api_key = "Your Portkey API Key", # Add your virtual key here virtual_key = "Your Anyscale Virtual Key", ) }]assistant = AssistantAgent("assistant", llm_config={"config_list": config_list})user_proxy = UserProxyAgent("user_proxy", code_execution_config={"work_dir": "coding", "use_docker": False}) # IMPORTANT: set to True to run code in docker, recommendeduser_proxy.initiate_chat(assistant, message="Say this is also a test - part 2.")# This initiates an automated chat between the two agents to solve the task
from autogen import AssistantAgent, UserProxyAgent, config_list_from_json# Import the portkey library to fetch helper functionsfrom portkey_ai import PORTKEY_GATEWAY_URL, createHeadersconfig_list = [ { # Set a dummy value, since we'll pick the API key from the virtual key "api_key": 'X', # Pick the model from the provider of your choice "model": "mistralai/Mistral-7B-Instruct-v0.1", "base_url": PORTKEY_GATEWAY_URL, "api_type": "openai", # Portkey conforms to the openai api_type "default_headers": createHeaders( api_key = "Your Portkey API Key", # Add your Portkey config id config = "Your Config ID", ) }]assistant = AssistantAgent("assistant", llm_config={"config_list": config_list})user_proxy = UserProxyAgent("user_proxy", code_execution_config={"work_dir": "coding", "use_docker": False}) # IMPORTANT: set to True to run code in docker, recommendeduser_proxy.initiate_chat(assistant, message="Say this is also a test - part 2.")# This initiates an automated chat between the two agents to solve the task
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Portkey (Prisma AIRS AI Gateway) Docs","description":"Comprehensive documentation for AI Gateway, Guardrails, Observability, and Governance features.","colors":{"primary":"#0891B2","light":"#0891B2","dark":"#0891B2"},"logo":{"light":"https://mintcdn.com/portkey-docs/tHk-hgNjLbEj4dhh/images/portkey-PANW-company-logo-positive.png?fit=max\u0026auto=format\u0026n=tHk-hgNjLbEj4dhh\u0026q=85\u0026s=c5fb09014ff79616583b1d3bffe27450","dark":"https://mintcdn.com/portkey-docs/tHk-hgNjLbEj4dhh/images/portkey-PANW-company-logo-negative.png?fit=max\u0026auto=format\u0026n=tHk-hgNjLbEj4dhh\u0026q=85\u0026s=6025ca49ef544522f58ff471b7f75f8f"},"favicon":"https://mintcdn.com/portkey-docs/Hf1XgyjG_b79ym4Q/favicon.png?fit=max\u0026auto=format\u0026n=Hf1XgyjG_b79ym4Q\u0026q=85\u0026s=cbaa1bfc49bb6e3fd6cf499a5da313a3","api":{"openapi":"https://raw.githubusercontent.com/Portkey-AI/openapi/refs/heads/master/openapi.yaml","examples":{"prefill":true},"url":"full"},"navbar":{"links":[{"href":"https://portkey.ai/models","label":"Models"},{"href":"https://support.portkey.ai/forms/customer-portal-ticket-form","label":"Support"},{"href":"https://www.paloaltonetworks.in/ai-security/ai-gateway?utm_source=portkey\u0026utm_medium=referral\u0026utm_campaign=prisma_airs\u0026utm_content=docs_nav#contact","label":"Contact Us"}],"primary":{"type":"button","label":"Sign in","href":"https://stratacloudmanager.paloaltonetworks.com/"}},"footer":{"socials":{"x":"https://twitter.com/PortkeyAI","linkedin":"https://www.linkedin.com/company/portkey-ai","github":"https://git.new/portkey"},"links":[{"header":"For LLMs","items":[{"label":"llms.txt","href":"https://portkey.ai/docs/llms.txt"},{"label":"llms-full.txt","href":"https://portkey.ai/docs/llms-full.txt"}]},{"header":"Products","items":[{"label":"Observability","href":"https://portkey.ai/features/observability"},{"label":"AI Gateway","href":"https://portkey.ai/features/ai-gateway"},{"label":"Guardrails","href":"https://portkey.ai/features/guardrails"},{"label":"Prompt Management","href":"https://portkey.ai/features/prompt-management"},{"label":"Agents","href":"https://portkey.ai/features/agents"},{"label":"MCP Gateway","href":"https://portkey.ai/docs/product/mcp-gateway"},{"label":"Security","href":"https://portkey.ai/features/security-and-compliance"},{"label":"Auto-Instrumentation","href":"https://portkey.ai/features/auto-instrumentation"}]},{"header":"Resources","items":[{"label":"API Status","href":"https://status.portkey.ai/"},{"label":"Helm Charts","href":"https://github.com/portkey-ai/helm"},{"label":"AI Grants Finder","href":"https://grantsfinder.portkey.ai/"},{"label":"Events Calendar","href":"https://lu.ma/portkey"},{"label":"Blog","href":"https://portkey.ai/blog"},{"label":"Error Library","href":"https://portkey.ai/error-library"},{"label":"Models \u0026 Pricing","href":"https://portkey.ai/models"}]},{"header":"Company","items":[{"label":"Pricing","href":"https://portkey.ai/pricing"},{"label":"Compliances","href":"https://trust.portkey.ai/"},{"label":"Privacy Policy","href":"https://portkey.ai/privacy-policy"},{"label":"Terms of Service","href":"https://portkey.ai/terms"},{"label":"DPA","href":"https://portkey.ai/dpa"},{"label":"Cookie Policy","href":"https://portkey.ai/cookie-policy"}]}]},"seo":{"metatags":{"og:type":"website","og:site_name":"Portkey AI Gateway Docs"},"indexing":"navigable"},"styling":{"eyebrows":"breadcrumbs","codeblocks":"system","latex":true},"integrations":{"ga4":{"measurementId":"G-JJMXYE4DRL"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"toc"},"interaction":{"drilldown":true},"metadata":{"timestamp":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"portkey-docs","hasAudioNarration":false,"actualSubdomain":"portkey-docs","customDomains":["docs.portkey.ai","portkey.ai"],"gitSource":{"type":"github","owner":"portkey-ai","repo":"docs-core","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae4a3f4c2eaceb0e3450b94","collectionId":"3fc5fddf-cd0a-44c8-8c84-d700aea81ada","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae4a3f4c2eaceb0e3450b94"},"feedback":{"thumbs":true,"edits":true,"issues":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae4a3f4c2eaceb0e3450b94","clientVersion":"0.0.4043","searchFilterCounts":[{"language":"default","tag":"Integrations","count":699},{"language":"default","tag":"Product","count":382},{"language":"default","tag":"Docs","count":320},{"language":"default","tag":"LLM Integrations","count":307},{"language":"default","tag":"More","count":176},{"language":"default","tag":"Admin APIs","count":172},{"language":"default","tag":"Guardrails","count":101},{"language":"default","tag":"AI Gateway","count":99},{"language":"default","tag":"Admin API","count":95},{"language":"default","tag":"Documentation","count":91}],"searchSettings":{"isFiltersEnabled":true,"showContentSnippets":true}},"assistantConfig":{"enableAskAiButton":true,"enableStarterQuestions":true,"enableContextualStarterQuestions":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@portkey.ai","showHelpButton":true}},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#banner{background:linear-gradient(90deg,#0d1b2e 0,#1a1040 40%,#2d0f22 100%);border-bottom:1px solid rgba(255,255,255,.08)}#banner a{color:#f0f0f0;text-decoration:none;font-weight:600;border-bottom:1px solid rgba(240,240,240,.5);padding-bottom:1px;transition:border-color .2s ease}#banner a:hover{border-bottom-color:#fff}"}],"page":{"pagePath":"virtual_key_old/integrations/libraries/autogen","slug":"/virtual_key_old/integrations/libraries/autogen","pageMetadata":{"title":"Autogen (DEPRECATED)","description":"AutoGen is a framework that enables the development of LLM applications using multiple agents that can converse with each other to solve tasks.","href":"/virtual_key_old/integrations/libraries/autogen"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"AutoGen is a framework that enables the development of LLM applications using multiple agents that can converse with each other to solve tasks.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{Card,CodeBlock,Frame,Heading,OptimizedImage}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);return _jsxs(_Fragment,{children:[_jsx(Card,{title:`This Integration is DEPRECATED`,icon:`robot`,href:`/integrations/agents/autogen`,children:_jsx(_components.p,{children:`Click here to check out the latest integration of Autogen with Portkey`})}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/portkey-docs/T0lFtdapIPX8YtCI/images/libraries/libraries-1.png?fit=max\u0026auto=format\u0026n=T0lFtdapIPX8YtCI\u0026q=85\u0026s=48a3723eac7f3e3b60a84ac48214449f`,\"data-og-width\":`1576`,width:`1576`,\"data-og-height\":`756`,height:`756`,\"data-path\":`images/libraries/libraries-1.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/portkey-docs/T0lFtdapIPX8YtCI/images/libraries/libraries-1.png?w=280\u0026fit=max\u0026auto=format\u0026n=T0lFtdapIPX8YtCI\u0026q=85\u0026s=468a4081ff415a58d6f04cb83b596875 280w, https://mintcdn.com/portkey-docs/T0lFtdapIPX8YtCI/images/libraries/libraries-1.png?w=560\u0026fit=max\u0026auto=format\u0026n=T0lFtdapIPX8YtCI\u0026q=85\u0026s=30f766083a6be8cc96dbf274cbfd55ae 560w, https://mintcdn.com/portkey-docs/T0lFtdapIPX8YtCI/images/libraries/libraries-1.png?w=840\u0026fit=max\u0026auto=format\u0026n=T0lFtdapIPX8YtCI\u0026q=85\u0026s=7a23af6d8758eac508ac7838febff49b 840w, https://mintcdn.com/portkey-docs/T0lFtdapIPX8YtCI/images/libraries/libraries-1.png?w=1100\u0026fit=max\u0026auto=format\u0026n=T0lFtdapIPX8YtCI\u0026q=85\u0026s=61664db9d39b9031e3bb58bd2bc736c3 1100w, https://mintcdn.com/portkey-docs/T0lFtdapIPX8YtCI/images/libraries/libraries-1.png?w=1650\u0026fit=max\u0026auto=format\u0026n=T0lFtdapIPX8YtCI\u0026q=85\u0026s=8386053b240f2e7f1251c4dc06801ea1 1650w, https://mintcdn.com/portkey-docs/T0lFtdapIPX8YtCI/images/libraries/libraries-1.png?w=2500\u0026fit=max\u0026auto=format\u0026n=T0lFtdapIPX8YtCI\u0026q=85\u0026s=97a465b2b319bdd6ae5cfb9584bb6f78 2500w`})}),`\n`,_jsx(_components.p,{children:`Find more information about Autogen here:`}),`\n`,_jsx(Heading,{level:`2`,id:`quick-start-integration`,children:`Quick Start Integration`}),`\n`,_jsxs(_components.p,{children:[`Autogen supports a concept of `,_jsx(_components.code,{children:`config\\\\_list`}),` which allows definitions of the LLM provider and model to be used. Portkey seamlessly integrates into the Autogen framework through a custom config we create.`]}),`\n`,_jsx(Heading,{level:`3`,id:`example-using-minimal-configuration`,children:`Example using minimal configuration`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`22`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`22`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` autogen `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AssistantAgent, UserProxyAgent, config_list_from_json`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Import the portkey library to fetch helper functions`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` portkey_ai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` PORTKEY_GATEWAY_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, createHeaders`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`config_list `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"api_key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Your OpenAI Key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-3.5-turbo\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"base_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`PORTKEY_GATEWAY_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"api_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"default_headers\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: createHeaders(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Your Portkey API Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` provider`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`assistant `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AssistantAgent(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`llm_config`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"config_list\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: config_list})`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`user_proxy `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` UserProxyAgent(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user_proxy\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`code_execution_config`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"work_dir\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"coding\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"use_docker\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# IMPORTANT: set to True to run code in docker, recommended`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`user_proxy.initiate_chat(assistant, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Say this is also a test - part 2.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# This initiates an automated chat between the two agents to solve the task`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Notice that we updated the `,_jsx(_components.code,{children:`base_url`}),` to Portkey’s AI Gateway and then added `,_jsx(_components.code,{children:`default_headers`}),` to enable Portkey specific features.`]}),`\n`,_jsx(_components.p,{children:`When we execute this script, it would yield the same results as without Portkey, but every request can now be inspected in the Portkey Analytics \u0026 Logs UI - including token, cost, accuracy calculations.`}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/portkey-docs/T0lFtdapIPX8YtCI/images/libraries/libraries-2.gif?s=47bd2af0719efeb4fb59ae102d7910fc`,\"data-og-width\":`1548`,width:`1548`,\"data-og-height\":`1080`,height:`1080`,\"data-path\":`images/libraries/libraries-2.gif`,\"data-optimize\":`true`,\"data-opv\":`3`})}),`\n`,_jsx(_components.p,{children:`All the config parameters supported in Portkey are available for use as part of the headers. Let’s look at some examples:`}),`\n`,_jsx(Heading,{level:`2`,id:`using-100+-models-in-autogen-through-portkey`,children:`Using 100+ models in Autogen through Portkey`}),`\n`,_jsxs(_components.p,{children:[`Since Portkey `,_jsx(_components.a,{href:`/integrations/llms`,children:`seamlessly connects to 150+ models across providers`}),`, you can easily connect any of these to now run with Autogen.`]}),`\n`,_jsxs(_components.p,{children:[`Let’s see an example using `,_jsx(_components.strong,{children:`Mistral-7B on Anyscale`}),` running with Autogen seamlessly:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`22`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`22`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` autogen `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AssistantAgent, UserProxyAgent, config_list_from_json`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Import the portkey library to fetch helper functions`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` portkey_ai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` PORTKEY_GATEWAY_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, createHeaders`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`config_list `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"api_key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Your Anyscale API Key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"mistralai/Mistral-7B-Instruct-v0.1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"base_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`PORTKEY_GATEWAY_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"api_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Portkey conforms to the openai api_type`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"default_headers\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: createHeaders(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Your Portkey API Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` provider`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"anyscale\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`assistant `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AssistantAgent(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`llm_config`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"config_list\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: config_list})`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`user_proxy `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` UserProxyAgent(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user_proxy\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`code_execution_config`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"work_dir\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"coding\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"use_docker\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# IMPORTANT: set to True to run code in docker, recommended`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`user_proxy.initiate_chat(assistant, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Say this is also a test - part 2.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# This initiates an automated chat between the two agents to solve the task`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`using-a-virtual-key`,children:`Using a Virtual Key`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/product/ai-gateway/virtual-keys`,children:`Virtual keys`}),` in Portkey allow you to easily switch between providers without manually having to store and change their API keys. Let’s use the same Mistral example above, but this time using a Virtual Key.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`27`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`27`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` autogen `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AssistantAgent, UserProxyAgent, config_list_from_json`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Import the portkey library to fetch helper functions`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` portkey_ai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` PORTKEY_GATEWAY_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, createHeaders`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`config_list `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Set a dummy value, since we'll pick the API key from the virtual key`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"api_key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'X'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Pick the model from the provider of your choice`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"mistralai/Mistral-7B-Instruct-v0.1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"base_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`PORTKEY_GATEWAY_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"api_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Portkey conforms to the openai api_type`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"default_headers\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: createHeaders(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Your Portkey API Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Add your virtual key here`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` virtual_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Your Anyscale Virtual Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`assistant `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AssistantAgent(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`llm_config`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"config_list\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: config_list})`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`user_proxy `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` UserProxyAgent(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user_proxy\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`code_execution_config`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"work_dir\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"coding\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"use_docker\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# IMPORTANT: set to True to run code in docker, recommended`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`user_proxy.initiate_chat(assistant, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Say this is also a test - part 2.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# This initiates an automated chat between the two agents to solve the task`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`using-configs`,children:`Using Configs`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/product/ai-gateway/configs`,children:`Configs`}),` in Portkey unlock advanced management and routing functionality including `,_jsx(_components.a,{href:`/product/ai-gateway/load-balancing`,children:`load balancing`}),`, `,_jsx(_components.a,{href:`/product/ai-gateway/fallbacks`,children:`fallbacks`}),`, `,_jsx(_components.a,{href:`/product/ai-gateway/canary-testing`,children:`canary testing`}),`, `,_jsx(_components.a,{href:`/product/ai-gateway/universal-api`,children:`switching models`}),` and more.`]}),`\n`,_jsx(_components.p,{children:`You can use Portkey configs in Autogen like this:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`27`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`27`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` autogen `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AssistantAgent, UserProxyAgent, config_list_from_json`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Import the portkey library to fetch helper functions`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` portkey_ai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` PORTKEY_GATEWAY_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, createHeaders`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`config_list `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Set a dummy value, since we'll pick the API key from the virtual key`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"api_key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'X'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Pick the model from the provider of your choice`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"mistralai/Mistral-7B-Instruct-v0.1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"base_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`PORTKEY_GATEWAY_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"api_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Portkey conforms to the openai api_type`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"default_headers\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: createHeaders(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Your Portkey API Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Add your Portkey config id`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` config`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Your Config ID\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`assistant `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AssistantAgent(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`llm_config`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"config_list\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: config_list})`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`user_proxy `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` UserProxyAgent(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user_proxy\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`code_execution_config`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"work_dir\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"coding\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"use_docker\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# IMPORTANT: set to True to run code in docker, recommended`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`user_proxy.initiate_chat(assistant, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Say this is also a test - part 2.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# This initiates an automated chat between the two agents to solve the task`})}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"system","config":{},"pageMetadata":{"title":"Autogen (DEPRECATED)","description":"AutoGen is a framework that enables the development of LLM applications using multiple agents that can converse with each other to solve tasks.","href":"/virtual_key_old/integrations/libraries/autogen"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Quick Start Integration","slug":"quick-start-integration","depth":2,"children":[{"title":"Example using minimal configuration","slug":"example-using-minimal-configuration","depth":3,"children":[]}]},{"title":"Using 100+ models in Autogen through Portkey","slug":"using-100+-models-in-autogen-through-portkey","depth":2,"children":[]},{"title":"Using a Virtual Key","slug":"using-a-virtual-key","depth":2,"children":[]},{"title":"Using Configs","slug":"using-configs","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"portkey-docs","siteName":"Portkey (Prisma AIRS AI Gateway) Docs","title":"Autogen (DEPRECATED) - Portkey (Prisma AIRS AI Gateway) Docs","relatedPagesConfig":{"enabled":true,"limit":5,"mode":"automatic"},"contextualStarterQuestions":[{"_id":"6aa972030031bd0287c978da","deploymentId":"67086365a151447bf2fa5021","questionText":"How do I integrate Autogen?","status":"active","generatedBy":"contextual","path":"virtual_key_old/integrations/libraries/autogen","createdAt":"2026-09-15T16:27:47.135Z","updatedAt":"2026-09-15T16:27:47.135Z","__v":0},{"_id":"6aa972030031bd0287c978db","deploymentId":"67086365a151447bf2fa5021","questionText":"What is the config_list parameter?","status":"active","generatedBy":"contextual","path":"virtual_key_old/integrations/libraries/autogen","createdAt":"2026-09-15T16:27:47.135Z","updatedAt":"2026-09-15T16:27:47.135Z","__v":0},{"_id":"6aa972030031bd0287c978dc","deploymentId":"67086365a151447bf2fa5021","questionText":"Where is the latest integration?","status":"active","generatedBy":"contextual","path":"virtual_key_old/integrations/libraries/autogen","createdAt":"2026-09-15T16:27:47.135Z","updatedAt":"2026-09-15T16:27:47.135Z","__v":0}],"navMaps":{"firstHrefInVersion":{"Latest":{"href":"/integrations/libraries/autogen","matchLevel":1},"Prisma AIRS":{"href":"/aigw/integrations/libraries/autogen","matchLevel":1},"Virtual Keys (Deprecated)":{"href":"/virtual_key_old/integrations/libraries/autogen","matchLevel":0}},"firstHrefInLanguage":{}},"lastModified":"2026-01-28T13:34:23.901Z","gitLastModified":"2025-09-18T10:35:40.000Z","originalFileLocation":"virtual_key_old/integrations/libraries/autogen.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"AutoGen is a framework that enables the development of LLM applications using multiple agents that can converse with each other to solve tasks.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Portkey (Prisma AIRS AI Gateway) Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Autogen (DEPRECATED) - Portkey (Prisma AIRS AI Gateway) Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"AutoGen is a framework that enables the development of LLM applications using multiple agents that can converse with each other to solve tasks.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Portkey AI Gateway Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.portkey.ai/docs/virtual_key_old/integrations/libraries/autogen\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://portkey-docs.mintlify.app/_mintlify/api/og/v2?division=Libraries\u0026amp;title=Autogen+%28DEPRECATED%29\u0026amp;description=AutoGen+is+a+framework+that+enables+the+development+of+LLM+applications+using+multiple+agents+that+can+converse+with+each+other+to+solve+tasks.\u0026amp;theme=262137c9f2583e48984715e7\u0026amp;signature=8ed0fde67b8e13c5f0a82f03dcdfa40b06dd9ab633dd9aac66d7d8d7abf36caf\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Autogen (DEPRECATED) - Portkey (Prisma AIRS AI Gateway) Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"AutoGen is a framework that enables the development of LLM applications using multiple agents that can converse with each other to solve tasks.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://portkey-docs.mintlify.app/_mintlify/api/og/v2?division=Libraries\u0026amp;title=Autogen+%28DEPRECATED%29\u0026amp;description=AutoGen+is+a+framework+that+enables+the+development+of+LLM+applications+using+multiple+agents+that+can+converse+with+each+other+to+solve+tasks.\u0026amp;theme=262137c9f2583e48984715e7\u0026amp;signature=8ed0fde67b8e13c5f0a82f03dcdfa40b06dd9ab633dd9aac66d7d8d7abf36caf\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Portkey (Prisma AIRS AI Gateway) Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0891B2\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.portkey.ai/docs/virtual_key_old/integrations/libraries/autogen\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/virtual_key_old/integrations/libraries/autogen.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.portkey.ai/#organization\",\"name\":\"Portkey (Prisma AIRS AI Gateway) Docs\",\"url\":\"https://docs.portkey.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/portkey-docs/tHk-hgNjLbEj4dhh/images/portkey-PANW-company-logo-positive.png?fit=max\u0026auto=format\u0026n=tHk-hgNjLbEj4dhh\u0026q=85\u0026s=c5fb09014ff79616583b1d3bffe27450\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.portkey.ai/docs#website\",\"name\":\"Portkey (Prisma AIRS AI Gateway) Docs\",\"url\":\"https://docs.portkey.ai/docs\",\"publisher\":{\"@id\":\"https://docs.portkey.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.portkey.ai/docs/virtual_key_old/integrations/libraries/autogen#webpage\",\"url\":\"https://docs.portkey.ai/docs/virtual_key_old/integrations/libraries/autogen\",\"name\":\"Autogen (DEPRECATED)\",\"description\":\"AutoGen is a framework that enables the development of LLM applications using multiple agents that can converse with each other to solve tasks.\",\"dateModified\":\"2025-09-18T10:35:40.000Z\",\"isPartOf\":{\"@id\":\"https://docs.portkey.ai/docs#website\"},\"breadcrumb\":{\"@id\":\"https://docs.portkey.ai/docs/virtual_key_old/integrations/libraries/autogen#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.portkey.ai/docs/virtual_key_old/integrations/libraries/autogen#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Libraries\",\"item\":\"https://docs.portkey.ai/docs/virtual_key_old/integrations/libraries\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Autogen (DEPRECATED)\",\"item\":\"https://docs.portkey.ai/docs/virtual_key_old/integrations/libraries/autogen\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.portkey.ai/docs/virtual_key_old/integrations/libraries/autogen#article\",\"headline\":\"Autogen (DEPRECATED)\",\"name\":\"Autogen (DEPRECATED)\",\"description\":\"AutoGen is a framework that enables the development of LLM applications using multiple agents that can converse with each other to solve tasks.\",\"url\":\"https://docs.portkey.ai/docs/virtual_key_old/integrations/libraries/autogen\",\"mainEntityOfPage\":{\"@id\":\"https://docs.portkey.ai/docs/virtual_key_old/integrations/libraries/autogen#webpage\"},\"dateModified\":\"2025-09-18T10:35:40.000Z\",\"publisher\":{\"@id\":\"https://docs.portkey.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.portkey.ai/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Portkey (Prisma AIRS AI Gateway) Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Portkey (Prisma AIRS AI Gateway) Docs","nav":{"global":null,"versions":[{"version":"Latest","pages":[{"title":"Latest","href":"/integrations/libraries/autogen"}]},{"version":"Prisma AIRS","pages":[{"title":"Prisma AIRS","href":"/aigw/integrations/libraries/autogen"}]},{"version":"Virtual Keys (Deprecated)","tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/virtual_key_old/introduction/what-is-portkey"}]},{"tab":"Integrations","groups":[{"group":"Ecosystem","pages":[{"title":"Integrations","href":"/virtual_key_old/integrations/ecosystem"},{"title":"Submit an Integration","url":"https://github.com/Portkey-AI/gateway/blob/main/.github/CONTRIBUTING.md","href":"/virtual_key_old/integrations/partner"}]},{"group":"LLM Integrations","pages":[{"title":"Overview","href":"/virtual_key_old/integrations/llms"},{"group":"OpenAI","pages":[{"title":"OpenAI","href":"/virtual_key_old/integrations/llms/openai"},{"title":"Structured Outputs","href":"/virtual_key_old/integrations/llms/openai/structured-outputs"},{"title":"Prompt Caching","href":"/virtual_key_old/integrations/llms/openai/prompt-caching-openai"},{"title":"Files","href":"/virtual_key_old/integrations/llms/openai/files"},{"title":"Batches","href":"/virtual_key_old/integrations/llms/openai/batches"},{"title":"Fine-tune","href":"/virtual_key_old/integrations/llms/openai/fine-tuning"}]},{"group":"Anthropic","pages":[{"title":"Anthropic","href":"/virtual_key_old/integrations/llms/anthropic"},{"title":"Prompt Caching","href":"/virtual_key_old/integrations/llms/anthropic/prompt-caching"},{"title":"Computer use tool","url":"/integrations/libraries/anthropic-computer-use","href":"/virtual_key_old/integrations/llms/anthropic/computer-use"}]},{"title":"Google Gemini","href":"/virtual_key_old/integrations/llms/gemini"},{"group":"Google Vertex AI","pages":[{"title":"Google Vertex AI","href":"/virtual_key_old/integrations/llms/vertex-ai"},{"title":"Files","href":"/virtual_key_old/integrations/llms/vertex-ai/files"},{"title":"Batches","href":"/virtual_key_old/integrations/llms/vertex-ai/batches"},{"title":"Fine-tune","href":"/virtual_key_old/integrations/llms/vertex-ai/fine-tuning"},{"title":"Controlled Generations","href":"/virtual_key_old/integrations/llms/vertex-ai/controlled-generations"},{"title":"Embeddings","href":"/virtual_key_old/integrations/llms/vertex-ai/embeddings"}]},{"group":"Azure","pages":[{"title":"Azure AI Foundry","href":"/virtual_key_old/integrations/llms/azure-foundry"},{"title":"Azure OpenAI","href":"/virtual_key_old/integrations/llms/azure-openai/azure-openai"},{"title":"Fine-tune","href":"/virtual_key_old/integrations/llms/azure-openai/fine-tuning"},{"title":"Files","href":"/virtual_key_old/integrations/llms/azure-openai/files"},{"title":"Batches","href":"/virtual_key_old/integrations/llms/azure-openai/batches"}]},{"group":"Bedrock","pages":[{"title":"AWS Bedrock","href":"/virtual_key_old/integrations/llms/bedrock/aws-bedrock"},{"title":"Files","href":"/virtual_key_old/integrations/llms/bedrock/files"},{"title":"Batches","href":"/virtual_key_old/integrations/llms/bedrock/batches"},{"title":"Fine-tune","href":"/virtual_key_old/integrations/llms/bedrock/fine-tuning"},{"title":"Prompt Caching on Bedrock","href":"/virtual_key_old/integrations/llms/bedrock/prompt-caching"},{"title":"Embeddings","href":"/virtual_key_old/integrations/llms/bedrock/embeddings"}]},{"title":"AWS SageMaker","href":"/virtual_key_old/integrations/llms/aws-sagemaker"},{"title":"Ollama","href":"/virtual_key_old/integrations/llms/ollama"},{"group":"More","pages":[{"title":"LocalAI","href":"/virtual_key_old/integrations/llms/local-ai"},{"title":"vLLM","href":"/virtual_key_old/integrations/llms/vllm"},{"title":"Triton","href":"/virtual_key_old/integrations/llms/triton"},{"title":"AI21","href":"/virtual_key_old/integrations/llms/ai21"},{"title":"Anyscale","href":"/virtual_key_old/integrations/llms/anyscale-llama2-mistral-zephyr"},{"title":"Cerebras","href":"/virtual_key_old/integrations/llms/cerebras"},{"title":"Cohere","href":"/virtual_key_old/integrations/llms/cohere"},{"group":"Fireworks","pages":[{"title":"Fireworks","href":"/virtual_key_old/integrations/llms/fireworks"},{"title":"Files","href":"/virtual_key_old/integrations/llms/fireworks/files"},{"title":"Fine-tune","href":"/virtual_key_old/integrations/llms/fireworks/fine-tuning"}]},{"title":"Dashscope","href":"/virtual_key_old/integrations/llms/dashscope"},{"title":"Deepinfra","href":"/virtual_key_old/integrations/llms/deepinfra"},{"title":"Deepbricks","href":"/virtual_key_old/integrations/llms/deepbricks"},{"title":"Deepgram","href":"/virtual_key_old/integrations/llms/deepgram"},{"title":"DeepSeek","href":"/virtual_key_old/integrations/llms/deepseek"},{"title":"Github","href":"/virtual_key_old/integrations/llms/github"},{"title":"Groq","href":"/virtual_key_old/integrations/llms/groq"},{"title":"Hugging Face","href":"/virtual_key_old/integrations/llms/huggingface"},{"title":"Inference.net","href":"/virtual_key_old/integrations/llms/inference.net"},{"title":"Jina AI","href":"/virtual_key_old/integrations/llms/jina-ai"},{"title":"Lambda Labs","href":"/virtual_key_old/integrations/llms/lambda"},{"title":"Lemonfox-AI","href":"/virtual_key_old/integrations/llms/lemon-fox"},{"title":"Lepton AI","href":"/virtual_key_old/integrations/llms/lepton"},{"title":"Lingyi (01.ai)","href":"/virtual_key_old/integrations/llms/lingyi-01.ai"},{"title":"Mistral AI","href":"/virtual_key_old/integrations/llms/mistral-ai"},{"title":"Monster API","href":"/virtual_key_old/integrations/llms/monster-api"},{"title":"Moonshot","href":"/virtual_key_old/integrations/llms/moonshot"},{"title":"Ncompass","href":"/virtual_key_old/integrations/llms/ncompass"},{"title":"Nomic","href":"/virtual_key_old/integrations/llms/nomic"},{"title":"Nscale (EU Sovereign)","href":"/virtual_key_old/integrations/llms/nscale"},{"title":"Novita AI","href":"/virtual_key_old/integrations/llms/novita-ai"},{"title":"Nebius","href":"/virtual_key_old/integrations/llms/nebius"},{"title":"OpenRouter","href":"/virtual_key_old/integrations/llms/openrouter"},{"title":"Perplexity AI","href":"/virtual_key_old/integrations/llms/perplexity-ai"},{"title":"Predibase","href":"/virtual_key_old/integrations/llms/predibase"},{"title":"Reka AI","href":"/virtual_key_old/integrations/llms/reka-ai"},{"title":"Recraft AI","href":"/virtual_key_old/integrations/llms/recraft-ai"},{"title":"SambaNova","href":"/virtual_key_old/integrations/llms/sambanova"},{"title":"Segmind","href":"/virtual_key_old/integrations/llms/segmind"},{"title":"Snowflake Cortex","href":"/virtual_key_old/integrations/llms/snowflake-cortex"},{"title":"Stability AI","href":"/virtual_key_old/integrations/llms/stability-ai"},{"title":"SiliconFlow","href":"/virtual_key_old/integrations/llms/siliconflow"},{"title":"Together AI","href":"/virtual_key_old/integrations/llms/together-ai"},{"title":"Upstage AI","href":"/virtual_key_old/integrations/llms/upstage"},{"title":"Voyage AI","href":"/virtual_key_old/integrations/llms/voyage-ai"},{"title":"Workers AI","href":"/virtual_key_old/integrations/llms/workers-ai"},{"title":"xAI","href":"/virtual_key_old/integrations/llms/x-ai"},{"title":"ZhipuAI / ChatGLM / BigModel","href":"/virtual_key_old/integrations/llms/zhipu"},{"title":"Replicate","href":"/virtual_key_old/integrations/llms/replicate"},{"title":"Suggest a new integration!","href":"/virtual_key_old/integrations/llms/suggest-a-new-integration"}]},{"title":"Bring Your Own LLM","href":"/virtual_key_old/integrations/llms/byollm"}]},{"group":"Cloud Platforms","pages":[{"title":"Microsoft Azure","href":"/virtual_key_old/integrations/cloud/azure"}]},{"group":"Guardrails","pages":[{"title":"Aporia","href":"/virtual_key_old/integrations/guardrails/aporia"},{"title":"Acuvity","href":"/virtual_key_old/integrations/guardrails/acuvity"},{"title":"Azure Guardrails","href":"/virtual_key_old/integrations/guardrails/azure-guardrails"},{"title":"AWS Bedrock Guardrails","href":"/virtual_key_old/integrations/guardrails/bedrock-guardrails"},{"title":"Lasso Security","href":"/virtual_key_old/integrations/guardrails/lasso"},{"title":"Mistral","href":"/virtual_key_old/integrations/guardrails/mistral"},{"title":"Pangea","href":"/virtual_key_old/integrations/guardrails/pangea"},{"title":"Patronus AI","href":"/virtual_key_old/integrations/guardrails/patronus-ai"},{"title":"Pillar","href":"/virtual_key_old/integrations/guardrails/pillar"},{"title":"Prompt Security","href":"/virtual_key_old/integrations/guardrails/prompt-security"},{"title":"Bring Your Own Guardrails","href":"/virtual_key_old/integrations/guardrails/bring-your-own-guardrails"}]},{"group":"Plugins","pages":[{"title":"Exa Online Search","href":"/virtual_key_old/integrations/plugins/exa"}]},{"group":"Vector Databases","pages":[{"title":"Milvus","href":"/virtual_key_old/integrations/vector-databases/milvus"},{"title":"Qdrant","href":"/virtual_key_old/integrations/vector-databases/qdrant"}]},{"group":"Agents","pages":[{"title":"Overview","href":"/virtual_key_old/integrations/agents"},{"title":"OpenAI Agents SDK (Python)","href":"/virtual_key_old/integrations/agents/openai-agents"},{"title":"OpenAI Agents SDK (TypeScript)","href":"/virtual_key_old/integrations/agents/openai-agents-ts"},{"title":"Autogen","href":"/virtual_key_old/integrations/agents/autogen"},{"title":"Control Flow","href":"/virtual_key_old/integrations/agents/control-flow"},{"title":"CrewAI","href":"/virtual_key_old/integrations/agents/crewai"},{"title":"Langchain Agents","href":"/virtual_key_old/integrations/agents/langchain-agents"},{"title":"Langroid","url":"https://langroid.github.io/langroid/notes/portkey","href":"/virtual_key_old/integrations/agents/langroid"},{"title":"LangGraph","href":"/virtual_key_old/integrations/agents/langgraph"},{"title":"LiveKit","href":"/virtual_key_old/integrations/agents/livekit"},{"title":"Llama Agents by Llamaindex","href":"/virtual_key_old/integrations/agents/llama-agents"},{"title":"OpenAI Swarm","href":"/virtual_key_old/integrations/agents/openai-swarm"},{"title":"Pydantic AI","href":"/virtual_key_old/integrations/agents/pydantic-ai"},{"title":"Phidata","href":"/virtual_key_old/integrations/agents/phidata"},{"title":"Strands Agents","href":"/virtual_key_old/integrations/agents/strands"},{"title":"Bring Your own Agents","href":"/virtual_key_old/integrations/agents/bring-your-own-agents"}]},{"group":"AI Apps","pages":[{"title":"Overview","href":"/virtual_key_old/integrations/ai-apps"},{"title":"Anything LLM","href":"/virtual_key_old/integrations/libraries/anythingllm"},{"group":"Claude Code","pages":[{"title":"Claude Code","href":"/virtual_key_old/integrations/libraries/claude-code"},{"title":"Claude Code with Anthropic","href":"/virtual_key_old/integrations/libraries/claude-code-anthropic"},{"title":"Claude Code with Amazon Bedrock","href":"/virtual_key_old/integrations/libraries/claude-code-bedrock"},{"title":"Claude Code with Google Vertex AI","href":"/virtual_key_old/integrations/libraries/claude-code-vertex"}]},{"title":"Anthropic Computer Use","href":"/virtual_key_old/integrations/libraries/anthropic-computer-use"},{"title":"Cline","href":"/virtual_key_old/integrations/libraries/cline"},{"title":"Goose","href":"/virtual_key_old/integrations/libraries/goose"},{"title":"Jan","href":"/virtual_key_old/integrations/libraries/janhq"},{"group":"Librechat","pages":[{"title":"LibreChat","href":"/virtual_key_old/integrations/libraries/librechat"},{"title":"Web Search for Any LLM in LibreChat","href":"/guides/use-cases/librechat-web-search"}]},{"title":"n8n","href":"/virtual_key_old/integrations/libraries/n8n"},{"title":"OpenAI Codex CLI","href":"/virtual_key_old/integrations/libraries/codex"},{"title":"Open WebUI","href":"/virtual_key_old/integrations/libraries/openwebui"},{"title":"Roo Code","href":"/virtual_key_old/integrations/libraries/roo-code"},{"title":"Zed","href":"/virtual_key_old/integrations/libraries/zed"}]},{"group":"Libraries","pages":[{"title":"Overview","description":null,"href":"/virtual_key_old/integrations/libraries"},{"title":"Autogen (DEPRECATED)","href":"/virtual_key_old/integrations/libraries/autogen"},{"title":"DSPy","description":"Integrate DSPy with Portkey for production-ready LLM pipelines","href":"/virtual_key_old/integrations/libraries/dspy"},{"title":"Instructor","href":"/virtual_key_old/integrations/libraries/instructor"},{"title":"Langchain (Python)","href":"/virtual_key_old/integrations/libraries/langchain-python"},{"title":"Langchain (JS/TS)","href":"/virtual_key_old/integrations/libraries/langchain-js"},{"title":"LlamaIndex (Python)","href":"/virtual_key_old/integrations/libraries/llama-index-python"},{"title":"Promptfoo","href":"/virtual_key_old/integrations/libraries/promptfoo"},{"title":"Vercel","href":"/virtual_key_old/integrations/libraries/vercel"},{"title":"MindsDb","href":"/virtual_key_old/integrations/libraries/mindsdb"},{"title":"ToolJet","href":"/virtual_key_old/integrations/libraries/tooljet"},{"title":"MongoDB","href":"/virtual_key_old/integrations/libraries/mongodb"},{"title":"Supabase","href":"/virtual_key_old/integrations/libraries/supabase"},{"title":"Zed","href":"/virtual_key_old/integrations/libraries/zed"},{"title":"Portkey with Any OpenAI Compatible Project","href":"/virtual_key_old/integrations/libraries/openai-compatible"},{"title":"Microsoft Semantic Kernel","url":"/api-reference/inference-api/sdks/c-sharp#using-portkey-with-semantic-kernel","href":"/virtual_key_old/integrations/libraries/microsoft-semantic-kernel"}]},{"group":"Tracing Providers","pages":[{"title":"Arize Phoenix","href":"/virtual_key_old/integrations/tracing-providers/arize"},{"title":"Pydantic Logfire","href":"/virtual_key_old/integrations/tracing-providers/logfire"}]}]},{"tab":"Inference API","pages":[{"title":"Inference API","href":"/api-reference/inference-api/introduction"}]},{"tab":"Admin API","pages":[{"title":"Admin API","href":"/api-reference/admin-api/introduction"}]},{"tab":"Cookbooks","pages":[{"title":"Cookbooks","href":"/guides/use-cases/run-batch-evals"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/2025/may"}]},{"tab":"Help articles","pages":[{"title":"Help articles","href":"/help-center/you-do-not-have-enough-permissions"}]}]}]},"basePath":"","title":"Autogen (DEPRECATED) - Portkey (Prisma AIRS AI Gateway) Docs","buildId":"dpl_4RHMRqtvdHvKgaEfTTjFqjzja3B6","deploymentId":"dpl_4RHMRqtvdHvKgaEfTTjFqjzja3B6","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-CSp1VigC.js","DynamicMarkdown-Dnt6YhtR.js","zoom-image-lightbox-CZTaVDTN.js","lightbox-handle-r17bVUz3.js"]}