docs, cli[patch]: chat model doc template (#22290)

Update ChatModel integration doc template, integration docstring, and
adds langchain-cli command to easily create just doc (for updating
existing integrations):

```bash
langchain-cli integration create-doc --name "foo-bar"
```
This commit is contained in:
Bagatur
2024-05-29 13:34:58 -07:00
committed by GitHub
parent f40e341a03
commit 627a337887
5 changed files with 549 additions and 85 deletions

View File

@@ -135,25 +135,17 @@
"source": [
"from langchain_openai import ChatOpenAI\n",
"\n",
"llm = ChatOpenAI(model=\"gpt-4o\", temperature=0)"
]
},
{
"cell_type": "markdown",
"id": "4e5fe97e",
"metadata": {},
"source": [
"The above cell that your OpenAI API key is set in your environment variables. If you would prefer you can specify credentials like API key, organization ID, base url, etc. as init params:\n",
"\n",
"```python\n",
"llm = ChatOpenAI(\n",
" model=\"gpt-4o\", \n",
" temperature=0, \n",
" api_key=\"YOUR_API_KEY\", \n",
" organization=\"YOUR_ORGANIZATION_ID\", \n",
" base_url=\"YOUR_BASE_URL\"\n",
")\n",
"```"
" model=\"gpt-4o\",\n",
" temperature=0,\n",
" max_tokens=None,\n",
" timeout=None,\n",
" max_retries=2,\n",
" # api_key=\"...\", # if you prefer to pass api key in directly instaed of using env vars\n",
" # base_url=\"...\",\n",
" # organization=\"...\",\n",
" # other params...\n",
")"
]
},
{
@@ -220,7 +212,7 @@
"source": [
"## Chaining\n",
"\n",
"We can chain our model with a prompt template like so:"
"We can [chain](/docs/how_to/sequence/) our model with a prompt template like so:"
]
},
{