Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from openai import OpenAI
|
3 |
+
import os
|
4 |
+
apikey=os.getenv("openapikey")
|
5 |
+
client = OpenAI(api_key=apikey)
|
6 |
+
|
7 |
+
def completion(type,time):
|
8 |
+
value=client.chat.completions.create(
|
9 |
+
model="gpt-4o",
|
10 |
+
messages=[
|
11 |
+
{
|
12 |
+
"role": "assistant",
|
13 |
+
"content": "talk like lawer your role is create a legal agreement documentation"
|
14 |
+
},
|
15 |
+
{
|
16 |
+
"role": "user",
|
17 |
+
"content": "create a {type} documentation of {time} year"
|
18 |
+
}])
|
19 |
+
return (value.choices[0].message.content)
|
20 |
+
|
21 |
+
st.title("LEGAL AGREMENT BOT")
|
22 |
+
|
23 |
+
option=["Rental Agreement" ,
|
24 |
+
"Lease Agreement" ,
|
25 |
+
"Employment Agreement" ,
|
26 |
+
"Non-Disclosure Agreement" ,
|
27 |
+
"Service Agreement" ,
|
28 |
+
"Partnership Agreement",
|
29 |
+
"Sales Agreement",
|
30 |
+
"Loan Agreement",
|
31 |
+
"Franchise Agreement",
|
32 |
+
"Consulting Agreement",
|
33 |
+
"Confidentiality Agreement",
|
34 |
+
"Licensing Agreement",
|
35 |
+
"Indemnity Agreement ",
|
36 |
+
"Joint Venture Agreement",
|
37 |
+
"Power of Attorney",
|
38 |
+
"Settlement Agreement",
|
39 |
+
"Shareholder Agreement",
|
40 |
+
"Manufacturing Agreement ",
|
41 |
+
"Purchase Agreement"
|
42 |
+
]
|
43 |
+
|
44 |
+
type=st.selectbox("Select the type of agreement ",options=option)
|
45 |
+
time=st.number_input("Select the time in years",step= 1)
|
46 |
+
if st.button("Submit"):
|
47 |
+
st.write(completion(type,time))#.choices[0].message.content)
|