File size: 537 Bytes
d967c00
 
 
a3e054f
 
 
 
 
d967c00
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from langchain_openai import ChatOpenAI
from langchain_core.messages import HumanMessage, SystemMessage

import streamlit as st

st.set_page_config(layout="wide", page_title="LegisQA")

st.write("hello")
llm = ChatOpenAI(
    openai_api_key=st.secrets["openai_api_key"]
)

messages = [
    SystemMessage(
        content="You are a helpful assistant that translates English to French."
    ),
    HumanMessage(
        content="Translate this sentence from English to French. I love programming."
    ),
]
st.write(llm.invoke(messages))