unifyh 2023-10-10 06:40:27 +08:00 committed by GitHub
parent 316dddc7cd
commit fd7f129f10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 5 deletions

View File

@ -37,7 +37,8 @@ import os
import predictionguard as pg
from langchain.llms import PredictionGuard
from langchain.prompts import PromptTemplate\nfrom langchain.chains import LLMChain
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChain
# Your Prediction Guard API key. Get one at predictionguard.com
os.environ["PREDICTIONGUARD_TOKEN"] = "<your Prediction Guard access token>"
@ -76,7 +77,8 @@ Basic LLM Chaining with the Prediction Guard wrapper:
```python
import os
from langchain.prompts import PromptTemplate\nfrom langchain.chains import LLMChain
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChain
from langchain.llms import PredictionGuard
# Optional, add your OpenAI API Key. This is optional, as Prediction Guard allows

View File

@ -20,7 +20,8 @@ As of June 2023, the API supports Vicuna-13B by default. We are going to support
For example
```python
from langchain.llms import OpenAI
from langchain.prompts import PromptTemplate\nfrom langchain.chains import LLMChain
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChain
import os
os.environ['OPENAI_API_BASE'] = "https://shale.live/v1"

View File

@ -20,7 +20,9 @@ Do necessary imports, etc.
```python
from langchain.agents import Tool, AgentExecutor, LLMSingleActionAgent, AgentOutputParser
from langchain.prompts import StringPromptTemplate
from langchain.llms import OpenAI\nfrom langchain.utilities import SerpAPIWrapper\nfrom langchain.chains import LLMChain
from langchain.llms import OpenAI
from langchain.utilities import SerpAPIWrapper
from langchain.chains import LLMChain
from typing import List, Union
from langchain.schema import AgentAction, AgentFinish, OutputParserException
import re

View File

@ -1,5 +1,7 @@
```python
from langchain.prompts import PromptTemplate\nfrom langchain.llms import OpenAI\nfrom langchain.chains import LLMChain
from langchain.prompts import PromptTemplate
from langchain.llms import OpenAI
from langchain.chains import LLMChain
prompt_template = "What is a good name for a company that makes {product}?"