File size: 444 Bytes
5bd6c7f
 
8532637
5bd6c7f
3de6db3
da96782
5bd6c7f
da96782
5bd6c7f
3de6db3
8532637
 
 
 
03b400c
5bd6c7f
d02575f
8532637
3de6db3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
from langchain.llms import OpenAI
from langchain.llms import PromptLayerOpenAI


def chatOpenAI(input):
    llm = OpenAI(temperature=0.9)
    return llm(input)


def promptLayer(input):
    llm = PromptLayerOpenAI(pl_tags=["LangChainGo"])
    return llm(input)


with gr.Blocks() as demo:
    gr.Markdown("# LangChain Test,LLM跑步上车。")
    gr.Interface(fn=promptLayer, inputs="text", outputs="text")
demo.launch()