import osimport requestsimport timeimport jsonimport timefrom langchain.llms import OpenAIAPI_SECRET_KEY = "你在aihubmix的key";BASE_URL = "https://aihubmix.com/v1"; #aihubmix的base-urlos.environ["OPENAI_API_KEY"] = API_SECRET_KEYos.environ["OPENAI_API_BASE"] = BASE_URLdef text(): llm = OpenAI(temperature=0.9) text = "What would be a good company name for a company that makes colorful socks?" print(llm(text))if __name__ == '__main__': text();
執行後可以看到返回:
Lively Socks.
最後更新:2026-06-01
⌘I
{"docsConfig":{"theme":"maple","$schema":"https://mintlify.com/docs.json","name":"AIHubMix","colors":{"primary":"#2563EB","light":"#7298FF","dark":"#2563EB"},"logo":{"light":"https://mintcdn.com/aihubmix/4M5Ijn4uterRbt_v/logo/light.svg?fit=max\u0026auto=format\u0026n=4M5Ijn4uterRbt_v\u0026q=85\u0026s=cfc912408caea6ea63a70c908855d80b","dark":"https://mintcdn.com/aihubmix/4M5Ijn4uterRbt_v/logo/dark.svg?fit=max\u0026auto=format\u0026n=4M5Ijn4uterRbt_v\u0026q=85\u0026s=a93af1a4b6cca0f4807ebfa4f08606a5","href":"https://aihubmix.com"},"favicon":"https://mintcdn.com/aihubmix/wvLBC2rudZx6kP2C/favicon.svg?fit=max\u0026auto=format\u0026n=wvLBC2rudZx6kP2C\u0026q=85\u0026s=3ceb0f890a06ba81303020aeb3a5662b","api":{"openapi":"openapi.json","playground":{"display":"interactive","proxy":true},"examples":{"defaults":"required","languages":["curl","python"],"prefill":false,"autogenerate":true},"url":"full","mdx":{"auth":{"method":"bearer"},"server":["https://aihubmix.com","https://api.inferera.com"]}},"navbar":{"primary":{"type":"button","label":"Quick Start","href":"https://aihubmix.com"}},"seo":{"metatags":{"charset":"UTF-8","viewport":"width=device-width, initial-scale=1.0","description":"AiHubMix is a comprehensive AI model API routing service, providing unified access to OpenAI, Claude, Gemini, Deepseek, Qwen, and more. Effortlessly integrate LLMs, multimodal AI, and developer tools with a single, standardized API.","keywords":"AI, documentation, AiHubMix, LLM, API, integration, developer, OpenAI, Claude, Gemini, Deepseek, Qwen, multimodal, image generation, text-to-speech, embeddings, reranking, video processing","author":"AIHubMix","article:author":"AIHubMix","og:type":"website","og:image":"https://assets.aihubmix.com/docs/og-image.webp","og:description":"Unified API docs for OpenAI, Claude, Gemini, Deepseek, Qwen, and more. Integrate LLMs and multimodal AI with ease.","og:site_name":"AiHubMix","twitter:card":"summary_large_image","twitter:description":"Unified API docs for OpenAI, Claude, Gemini, Deepseek, Qwen, and more. Integrate LLMs and multimodal AI with ease.","twitter:image":"https://assets.aihubmix.com/docs/og-image.webp","theme-color":"#2563EB","color-scheme":"light dark","referrer":"origin","distribution":"global","category":"Technology","apple-mobile-web-app-capable":"yes","application-name":"AiHubMix","msapplication-TileColor":"#2563EB","google-site-verification":"O8gGkZVV1R0quPlvC2DKGS2J05Ab5D2VJ2jUFKUld_s"}},"integrations":{"ga4":{"measurementId":"G-9KBSNEHPLG"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","cursor","vscode"],"display":"header"},"thumbnails":{},"styling":{"latex":true},"navigation":{"languages":[{"language":"zh-Hans","href":"cn"},{"language":"en","href":"en"},{"language":"ja","href":"jp"},{"language":"ko","href":"ko"},{"language":"zh-Hant","href":"zh-Hant"},{"language":"fr","href":"fr"},{"language":"de","href":"de"},{"language":"es","href":"es"},{"language":"pt","href":"pt"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"aihubmix","hasAudioNarration":false,"actualSubdomain":"aihubmix","customDomains":["docs.aihubmix.com"],"gitSource":{"type":"github","owner":"aihubmix","repo":"inferera-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6affe115487aa785fd22f052","clientVersion":"0.0.4248","searchFilterCounts":[{"language":"zh-Hans","tag":"文档","count":78},{"language":"de","tag":"Docs","count":78},{"language":"en","tag":"Docs","count":78},{"language":"es","tag":"Docs","count":78},{"language":"fr","tag":"Docs","count":78},{"language":"ja","tag":"ドキュメント","count":78},{"language":"ko","tag":"문서","count":78},{"language":"pt","tag":"Docs","count":78},{"language":"zh-Hant","tag":"文件","count":78},{"language":"zh-Hans","tag":"API 参考","count":42},{"language":"de","tag":"API-Referenz","count":42},{"language":"en","tag":"API Reference","count":42},{"language":"es","tag":"Referencia de API","count":42},{"language":"fr","tag":"Référence API","count":42},{"language":"ja","tag":"API リファレンス","count":42},{"language":"ko","tag":"API 레퍼런스","count":42},{"language":"pt","tag":"Referência da API","count":42},{"language":"zh-Hant","tag":"API 參考","count":42},{"language":"zh-Hans","tag":"模型端点","count":30},{"language":"de","tag":"Modell-Endpunkte","count":30},{"language":"en","tag":"Model Endpoints","count":30},{"language":"es","tag":"Endpoints de modelo","count":30},{"language":"fr","tag":"Endpoints de modèle","count":30},{"language":"ja","tag":"モデルエンドポイント","count":30},{"language":"ko","tag":"모델 엔드포인트","count":30},{"language":"pt","tag":"Endpoints de modelo","count":30},{"language":"zh-Hant","tag":"模型端點","count":30},{"language":"zh-Hans","tag":"应用集成","count":29},{"language":"de","tag":"Anwendungen","count":29},{"language":"en","tag":"Apps","count":29},{"language":"es","tag":"Aplicaciones","count":29},{"language":"fr","tag":"Applications","count":29},{"language":"ja","tag":"アプリ","count":29},{"language":"ko","tag":"앱","count":29},{"language":"pt","tag":"Aplicativos","count":29},{"language":"zh-Hant","tag":"應用整合","count":29},{"language":"zh-Hans","tag":"集成指南","count":25},{"language":"zh-Hans","tag":"云 Agent","count":24},{"language":"de","tag":"Integrationsleitfaden","count":24},{"language":"de","tag":"Cloud Agent","count":24},{"language":"en","tag":"Integration Guide","count":24},{"language":"en","tag":"Cloud Agent","count":24},{"language":"es","tag":"Guía de integración","count":24},{"language":"es","tag":"Cloud Agent","count":24},{"language":"fr","tag":"Guide d'intégration","count":24},{"language":"fr","tag":"Cloud Agent","count":24},{"language":"ja","tag":"統合ガイド","count":24},{"language":"ja","tag":"Cloud Agent","count":24},{"language":"ko","tag":"통합 가이드","count":24},{"language":"ko","tag":"Cloud Agent","count":24},{"language":"pt","tag":"Guia de integração","count":24},{"language":"pt","tag":"Cloud Agent","count":24},{"language":"zh-Hant","tag":"整合指南","count":24},{"language":"zh-Hant","tag":"雲 Agent","count":24},{"language":"zh-Hans","tag":"模型能力","count":23},{"language":"de","tag":"Modellfähigkeiten","count":23},{"language":"en","tag":"Model Capabilities","count":23},{"language":"es","tag":"Capacidades del modelo","count":23},{"language":"fr","tag":"Capacités des modèles","count":23},{"language":"ja","tag":"モデル機能","count":23},{"language":"ko","tag":"모델 기능","count":23},{"language":"pt","tag":"Capacidades do modelo","count":23},{"language":"zh-Hant","tag":"模型能力","count":23},{"language":"zh-Hans","tag":"协议参考","count":17},{"language":"zh-Hans","tag":"开始使用","count":16},{"language":"de","tag":"Erste Schritte","count":16},{"language":"de","tag":"Protokoll-Referenz","count":16},{"language":"en","tag":"Protocol Reference","count":16},{"language":"es","tag":"Referencia de protocolo","count":16},{"language":"fr","tag":"Référence du protocole","count":16},{"language":"ja","tag":"はじめに","count":16},{"language":"ja","tag":"プロトコルリファレンス","count":16},{"language":"ko","tag":"시작하기","count":16},{"language":"ko","tag":"프로토콜 참조","count":16},{"language":"pt","tag":"Referência de protocolo","count":16},{"language":"zh-Hant","tag":"開始使用","count":16},{"language":"zh-Hant","tag":"協定參考","count":16},{"language":"de","tag":"Chat-Clients","count":15},{"language":"en","tag":"Chat Clients","count":15},{"language":"es","tag":"Clientes de chat","count":15},{"language":"fr","tag":"Clients de chat","count":15},{"language":"ja","tag":"チャットクライアント","count":15},{"language":"ko","tag":"채팅 클라이언트","count":15},{"language":"pt","tag":"Clientes de chat","count":15},{"language":"zh-Hant","tag":"通用 Chat 客戶端","count":15},{"language":"zh-Hans","tag":"编程助手","count":14},{"language":"en","tag":"AIHubMix Unified API","count":14},{"language":"es","tag":"AIHubMix Unified API","count":14},{"language":"fr","tag":"AIHubMix Unified API","count":14},{"language":"pt","tag":"AIHubMix Unified API","count":14}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","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":"rbac-expansion","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":"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":"site-roles","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":"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":"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},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"brand.css","content":":root{--ahm-brand-logo: url('/logo/light.svg')}:root.dark{--ahm-brand-logo: url('/logo/dark.svg')}:root:is(:lang(cn),:lang(zh)){--ahm-brand-logo: url('/logo/zh-light.svg')}:root.dark:is(:lang(cn),:lang(zh)){--ahm-brand-logo: url('/logo/zh-dark.svg')}.nav-logo{content:var(--ahm-brand-logo);width:110px!important;height:24px!important;max-width:110px!important;padding:0!important;object-fit:contain;object-position:left center}footer a[href*=\"mintlify\"]{display:none!important}html[data-current-path$=\"/guides/aihubmix-score\"] table td{min-width:88px!important}.katex .katex-mathml{position:absolute;clip:rect(1px, 1px, 1px, 1px);padding:0;border:0;height:1px;width:1px;overflow:hidden}html[data-current-path$=\"/guides/aihubmix-score\"] .katex-display,html[data-current-path$=\"/guides/aihubmix-score\"] .katex-display>.katex{overflow:visible!important}@media (max-width: 560px){html[data-current-path$=\"/guides/aihubmix-score\"] .katex-display>.katex{font-size:0.90em}}@media (max-width: 480px){html[data-current-path$=\"/guides/aihubmix-score\"] .katex-display>.katex{font-size:0.78em}}"},{"filePath":"media-error-tables.css","content":".media-error-table [data-component-part=\"scroll-area-content\"]{min-width:592px!important;width:100%}@media (min-width: 1024px){.media-error-table [data-component-part=\"scroll-area-content\"]{min-width:100%!important}}.media-error-table table{table-layout:fixed}.media-error-table th,.media-error-table td{min-width:0!important;overflow-wrap:anywhere}.media-error-http th:nth-child(1){width:9%}.media-error-http th:nth-child(2){width:25%}.media-error-http th:nth-child(3),.media-error-http th:nth-child(4){width:33%}.media-error-task th:nth-child(1){width:26%}.media-error-task th:nth-child(2){width:38%}.media-error-task th:nth-child(3){width:36%}"}]}
{"page":{"pagePath":"zh-Hant/clients/LangChain","slug":"/zh-Hant/clients/LangChain","pageMetadata":{"title":"在 LangChain 中使用","image":"/og-image.webp","description":null,"href":"/zh-Hant/clients/LangChain"},"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`,br:`br`,code:`code`,hr:`hr`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Heading}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`下載地址:`,_jsx(_components.a,{href:`https://www.langchain.com/`,children:`https://www.langchain.com/`})]}),`\n`,_jsx(Heading,{level:`3`,id:`最簡單的就是:直接設定環境變數程式碼如下`,children:`最簡單的就是:直接設定環境變數程式碼如下`}),`\n`,_jsx(CodeBlock,{numberOfLines:`6`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`API_SECRET_KEY = \"sk-pvMtoVO******66249058b93C766F2D70167\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`BASE_URL = \"https://aihubmix.com/v1\"; #aihubmix的base-url`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`os.environ[\"OPENAI_API_KEY\"] = API_SECRET_KEY`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`os.environ[\"OPENAI_BASE_URL\"] = BASE_URL`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`注意:openai_api_base 的末尾要加上 /v1,`}),`\n`,_jsx(CodeBlock,{filename:`langchain.chat_models import ChatOpenAI`,numberOfLines:`10`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`llm = ChatOpenAI(`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` openai_api_base=\"https://aihubmix.com/v1\", # 注意,末尾要加 /v1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` openai_api_key=\"sk-3133f******fee269b71d\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`res = llm.predict(\"hello\")`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`print(res)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`範例程式碼,使用LLM進行預測`,_jsx(_components.br,{}),`\n`,`核心其實在於key和url的設定`,_jsx(_components.br,{}),`\n`,`方法有:`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`使用環境變數來設定`}),`\n`,_jsx(_components.li,{children:`使用變數來傳入`}),`\n`,_jsx(_components.li,{children:`使用手動設定環境變數`}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:`Python`,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:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\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:` langchain.llms `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`API_SECRET_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"你在aihubmix的key\"`}),_jsx(_components.span,{style:{color:`#82071E`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F44747`,\"--shiki-dark-font-style\":`inherit`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`BASE_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://aihubmix.com/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`#aihubmix的base-url`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"OPENAI_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` API_SECRET_KEY`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"OPENAI_API_BASE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` BASE_URL`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` text`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`():`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` llm `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`temperature`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.9`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` text `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"What would be a good company name for a company that makes colorful socks?\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(llm(text))`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` __name__`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '__main__'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` text()`}),_jsx(_components.span,{style:{color:`#82071E`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F44747`,\"--shiki-dark-font-style\":`inherit`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`執行後可以看到返回:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Lively Socks.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(_components.p,{children:`最後更新:2026-06-01`})]})}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":{"config":{},"pageMetadata":{"title":"在 LangChain 中使用","image":"/og-image.webp","description":null,"href":"/zh-Hant/clients/LangChain"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"最簡單的就是:直接設定環境變數程式碼如下","slug":"最簡單的就是:直接設定環境變數程式碼如下","depth":3,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"aihubmix","siteName":"AIHubMix","title":"在 LangChain 中使用 - AIHubMix","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"zh-Hans":{"href":"/cn/clients/LangChain","matchLevel":1},"en":{"href":"/en/clients/LangChain","matchLevel":1},"ja":{"href":"/jp/clients/LangChain","matchLevel":1},"ko":{"href":"/ko/clients/LangChain","matchLevel":1},"zh-Hant":{"href":"/zh-Hant/clients/LangChain","matchLevel":0},"fr":{"href":"/fr/clients/LangChain","matchLevel":1},"de":{"href":"/de/clients/LangChain","matchLevel":1},"es":{"href":"/es/clients/LangChain","matchLevel":1},"pt":{"href":"/pt/clients/LangChain","matchLevel":1}}},"lastModified":"2026-11-19T12:14:42.481Z","originalFileLocation":"zh-Hant/clients/LangChain.mdx","locale":"zh-Hant"},"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=\"AiHubMix is a comprehensive AI model API routing service, providing unified access to OpenAI, Claude, Gemini, Deepseek, Qwen, and more. Effortlessly integrate LLMs, multimodal AI, and developer tools with a single, standardized API.\">\u003cmeta data-mint-head name=\"keywords\" content=\"AI, documentation, AiHubMix, LLM, API, integration, developer, OpenAI, Claude, Gemini, Deepseek, Qwen, multimodal, image generation, text-to-speech, embeddings, reranking, video processing\">\u003cmeta data-mint-head name=\"application-name\" content=\"AIHubMix\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/aihubmix/oVt_FUKZRfRFWFpr/_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=\"/mintlify-assets/_mintlify/favicons/aihubmix/oVt_FUKZRfRFWFpr/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/aihubmix/oVt_FUKZRfRFWFpr/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/aihubmix/oVt_FUKZRfRFWFpr/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/aihubmix/oVt_FUKZRfRFWFpr/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/aihubmix/oVt_FUKZRfRFWFpr/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/aihubmix/oVt_FUKZRfRFWFpr/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/aihubmix/oVt_FUKZRfRFWFpr/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/aihubmix/oVt_FUKZRfRFWFpr/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"在 LangChain 中使用 - AIHubMix\">\u003cmeta data-mint-head property=\"og:description\" content=\"Unified API docs for OpenAI, Claude, Gemini, Deepseek, Qwen, and more. Integrate LLMs and multimodal AI with ease.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"AiHubMix\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.aihubmix.com/zh-Hant/clients/LangChain\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://assets.aihubmix.com/docs/og-image.webp\">\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=\"在 LangChain 中使用 - AIHubMix\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Unified API docs for OpenAI, Claude, Gemini, Deepseek, Qwen, and more. Integrate LLMs and multimodal AI with ease.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://assets.aihubmix.com/docs/og-image.webp\">\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=\"/mintlify-assets/_mintlify/favicons/aihubmix/oVt_FUKZRfRFWFpr/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"AIHubMix\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2563EB\">\u003cmeta data-mint-head name=\"charset\" content=\"UTF-8\">\u003cmeta data-mint-head name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\u003cmeta data-mint-head name=\"author\" content=\"AIHubMix\">\u003cmeta data-mint-head name=\"article:author\" content=\"AIHubMix\">\u003cmeta data-mint-head name=\"theme-color\" content=\"#2563EB\">\u003cmeta data-mint-head name=\"color-scheme\" content=\"light dark\">\u003cmeta data-mint-head name=\"referrer\" content=\"origin\">\u003cmeta data-mint-head name=\"distribution\" content=\"global\">\u003cmeta data-mint-head name=\"category\" content=\"Technology\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-capable\" content=\"yes\">\u003cmeta data-mint-head name=\"application-name\" content=\"AiHubMix\">\u003cmeta data-mint-head name=\"google-site-verification\" content=\"O8gGkZVV1R0quPlvC2DKGS2J05Ab5D2VJ2jUFKUld_s\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.aihubmix.com/zh-Hant/clients/LangChain\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/zh-Hant/clients/LangChain.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hant\" href=\"https://docs.aihubmix.com/zh-Hant/clients/LangChain\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hans\" href=\"https://docs.aihubmix.com/cn/clients/LangChain\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.aihubmix.com/en/clients/LangChain\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://docs.aihubmix.com/jp/clients/LangChain\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ko\" href=\"https://docs.aihubmix.com/ko/clients/LangChain\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"fr\" href=\"https://docs.aihubmix.com/fr/clients/LangChain\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"de\" href=\"https://docs.aihubmix.com/de/clients/LangChain\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"es\" href=\"https://docs.aihubmix.com/es/clients/LangChain\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"pt\" href=\"https://docs.aihubmix.com/pt/clients/LangChain\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.aihubmix.com/cn/clients/LangChain\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.aihubmix.com/#organization\",\"name\":\"AIHubMix\",\"url\":\"https://docs.aihubmix.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/aihubmix/4M5Ijn4uterRbt_v/logo/light.svg?fit=max\u0026auto=format\u0026n=4M5Ijn4uterRbt_v\u0026q=85\u0026s=cfc912408caea6ea63a70c908855d80b\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.aihubmix.com#website\",\"name\":\"AIHubMix\",\"url\":\"https://docs.aihubmix.com\",\"publisher\":{\"@id\":\"https://docs.aihubmix.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.aihubmix.com/zh-Hant/clients/LangChain#webpage\",\"url\":\"https://docs.aihubmix.com/zh-Hant/clients/LangChain\",\"name\":\"在 LangChain 中使用\",\"dateModified\":\"2026-11-19T12:14:42.481Z\",\"isPartOf\":{\"@id\":\"https://docs.aihubmix.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.aihubmix.com/zh-Hant/clients/LangChain#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.aihubmix.com/zh-Hant/clients/LangChain#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"SDK 與框架\",\"item\":\"https://docs.aihubmix.com/zh-Hant/api/AISDK\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"在 LangChain 中使用\",\"item\":\"https://docs.aihubmix.com/zh-Hant/clients/LangChain\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.aihubmix.com/zh-Hant/clients/LangChain#article\",\"headline\":\"在 LangChain 中使用\",\"name\":\"在 LangChain 中使用\",\"url\":\"https://docs.aihubmix.com/zh-Hant/clients/LangChain\",\"mainEntityOfPage\":{\"@id\":\"https://docs.aihubmix.com/zh-Hant/clients/LangChain#webpage\"},\"image\":\"https://assets.aihubmix.com/docs/og-image.webp\",\"dateModified\":\"2026-11-19T12:14:42.481Z\",\"publisher\":{\"@id\":\"https://docs.aihubmix.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.aihubmix.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"AIHubMix\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"AIHubMix\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/zh-Hant/clients/LangChain.md","siteName":"AIHubMix","nav":{"global":null,"languages":[{"language":"zh-Hans","pages":[{"title":"zh-Hans","href":"/cn/clients/LangChain"}]},{"language":"en","pages":[{"title":"en","href":"/en/clients/LangChain"}]},{"language":"ja","pages":[{"title":"ja","href":"/jp/clients/LangChain"}]},{"language":"ko","pages":[{"title":"ko","href":"/ko/clients/LangChain"}]},{"language":"zh-Hant","tabs":[{"tab":"文件","pages":[{"title":"文件","href":"/zh-Hant"}]},{"tab":"API 參考","pages":[{"title":"API 參考","href":"/zh-hant/api-reference/openai-compatible/create-a-chat-completion"}]},{"tab":"整合指南","pages":[{"title":"第三方整合技術指南","href":"/zh-Hant/api/Third-PartyIntegrationTechnicalGuide"},{"group":"程式設計助理","icon":"terminal","pages":[{"title":"Claude Code","href":"/zh-Hant/api/Claude-Code"},{"title":"Codex CLI 與桌面端接入 AIHubMix 教學","sidebarTitle":"Codex","href":"/zh-Hant/api/Codex-CLI"},{"title":"CodeBuddy","href":"/zh-Hant/clients/CodeBuddy"},{"title":"WorkBuddy","href":"/zh-Hant/clients/WorkBuddy"},{"title":"Gemini CLI","href":"/zh-Hant/api/Gemini-Cli"},{"title":"在 OpenCode 中使用 AiHubMix","href":"/zh-Hant/api/Opencode"},{"title":"DeepSeek Harness","href":"/zh-Hant/api/DeepSeek-Harness"},{"title":"Crush","href":"/zh-Hant/api/Crush"},{"title":"在 Gptme 中使用","href":"/zh-Hant/clients/Gptme"},{"title":"OpenClaw","href":"/zh-Hant/api/OpenClaw"},{"title":"Hermes Agent","href":"/zh-Hant/api/hermes-agent-ai-hubmix"},{"title":"Qwen Code","href":"/zh-Hant/api/Qwen-code"},{"title":"Kilo Code","href":"/zh-Hant/api/Kilo-Code"}]},{"group":"IDE 整合","icon":"code","pages":[{"title":"Cursor","href":"/zh-Hant/clients/Cursor"},{"title":"在 Cline 中使用","href":"/zh-Hant/clients/Cline"},{"title":"CC Switch 設定指南","href":"/zh-Hant/api/cc-switch"},{"title":"在 Avante.nvim 中使用","href":"/zh-Hant/clients/Avante.nvim"}]},{"group":"Agent / Workflow","icon":"diagram-project","pages":[{"title":"在 Dify 中使用","href":"/zh-Hant/clients/Dify"},{"title":"n8n","href":"/zh-Hant/clients/N8N"},{"title":"LiteLLM","href":"/zh-Hant/clients/using-lite-llm"}]},{"group":"SDK 與框架","icon":"cube","pages":[{"title":"AI SDK - Aihubmix 提供者","description":"在 AI SDK 中使用 Aihubmix 作為大型模型供應商,一個金鑰即可接入海量模型。","href":"/zh-Hant/api/AISDK"},{"title":"在 LangChain 中使用","href":"/zh-Hant/clients/LangChain"},{"title":"透過介面直接管理後台","description":"透過 AiHubMix CLI 實用管理腳本在命令列中管理密鑰、查看帳戶和可用模型列表等","href":"/zh-Hant/api/Cli"}]}]},{"tab":"應用整合","pages":[{"title":"應用整合","href":"/zh-Hant/clients/Cherry-Studio"}]},{"tab":"雲 Agent","pages":[{"title":"雲 Agent","href":"/zh-Hant/cloud"}]},{"tab":"部落格","pages":[{"title":"部落格","href":"/zh-Hant/blogs/kimi-k3-guide"}]},{"tab":"更新日誌","pages":[{"title":"更新日誌","href":"/zh-Hant/update/News"}]}]},{"language":"fr","pages":[{"title":"fr","href":"/fr/clients/LangChain"}]},{"language":"de","pages":[{"title":"de","href":"/de/clients/LangChain"}]},{"language":"es","pages":[{"title":"es","href":"/es/clients/LangChain"}]},{"language":"pt","pages":[{"title":"pt","href":"/pt/clients/LangChain"}]}]},"basePath":"","title":"在 LangChain 中使用 - AIHubMix","deploymentId":"dpl_2pTxFtyBudBMYZiCw1MyvoA1wxpd","buildId":"dpl_2pTxFtyBudBMYZiCw1MyvoA1wxpd","dynamics":[],"chunks":[]}