File size: 1,440 Bytes
b9e397f
d4caf59
09780df
1bc78de
09780df
b28c9c0
 
d4caf59
09780df
 
 
d4caf59
bac290c
b9e397f
 
fd69caf
b9e397f
 
bb990c3
b9e397f
 
 
09780df
48959bc
09780df
 
 
 
 
 
 
 
 
 
 
b9e397f
 
 
 
 
e857c72
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import streamlit as st
from PIL import Image
from groq import Groq
import os

st.image('endesa.jpeg', caption="", use_column_width=False)
st.image('calamo.png', caption="", use_column_width=False)

client = Groq(
    api_key=os.environ.get("GROQ_API_KEY"),
)
# Rest of your Streamlit app
st.write("# Inicio")

# Other content of your app
st.title("plAIn")
# Add more components here
# Create a text input widget
user_input = st.text_input('Pega tu texto:', 'Acuerdo de 28 de febrero de 2024, de la Comisi贸n Permanente del Consejo General del Poder Judicial, por el que se resuelve la convocatoria de oferta p煤blica entre miembros del Cuerpo Jur铆dico Militar, para la cobertura mediante suplencia profesional, en r茅gimen de comisi贸n de servicio con relevaci贸n de funciones, de plazas en 贸rganos de la jurisdicci贸n militar')

# Define a function to process the input
def process_text(input_text):
    prompt = "Eres un experto en lenguaje claro. Eval煤a la calidad del lenguaje de este texto:"
    input = prompt + input_text

    chat_completion = client.chat.completions.create(
    messages=[
        {
            "role": "user",
            "content": input,
        }
    ],
    model="mixtral-8x7b-32768",
)
    return (chat_completion.choices[0].message.content)

# Call the function with the user input
processed_output = process_text(user_input)

# Display the processed output
st.write('Texto procesado:', processed_output)