mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-06 01:45:27 +03:00
4.4 KiB
4.4 KiB
In [1]:
# Import Azure OpenAI
from langchain.llms import AzureOpenAIIn [2]:
# Create an instance of Azure OpenAI
# Replace the deployment name with your own
llm = AzureOpenAI(deployment_name="text-davinci-002-prod", model_name="text-davinci-002")In [3]:
# Run the LLM
llm("Tell me a joke")Out [3]:
'\n\nWhy did the chicken cross the road?\n\nTo get to the other side.'
In [4]:
print(llm)[1mAzureOpenAI[0m
Params: {'deployment_name': 'text-davinci-002', 'model_name': 'text-davinci-002', 'temperature': 0.7, 'max_tokens': 256, 'top_p': 1, 'frequency_penalty': 0, 'presence_penalty': 0, 'n': 1, 'best_of': 1}
In [ ]: