Spaces:
Running
Running
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)) | |