Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yogananda-muthaiah authored Dec 1, 2024
1 parent bb7b1cc commit 4d4b933
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,26 @@ pip install openai

Setting environment variables
When using LangChain, especially when using external APIs, you need to set the appropriate environment variables. For example, to set your OpenAI API key:
```
api_key = os.getenv("OPENAI_API_KEY")
```

## Basic use case
Once the installation and environment configuration are complete, you can check the operation of LangChain with a simple code like the following:
```
from langchain.llms import OpenAI
llm = OpenAI(temperature=0.9)
text = "What would be a good company name for a company that makes colorful socks?"
print(llm(text))
```



This code uses a model from OpenAI to generate names for companies that manufacture colorful socks.

Important points to note
LangChain is under active development, so we recommend regularly updating to the latest version.
Depending on the API or service you use, you may need to install or configure additional packages.
There may be fees for using the API, so be sure to check the terms of use and pricing.
With these steps, the basic environment for using LangChain will be ready.

0 comments on commit 4d4b933

Please sign in to comment.