File size: 708 Bytes
4dd70a8
 
 
e66e891
 
4dd70a8
 
 
 
 
e66e891
4dd70a8
e66e891
 
 
4dd70a8
 
 
e66e891
 
 
4dd70a8
 
 
 
e66e891
 
 
 
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
'''Main script to run gradio interface and MCP server.'''

import gradio as gr
import assets.html as html
from functions import tools as tool_funcs


with gr.Blocks() as demo:

    with gr.Row():
        gr.HTML(html.TITLE)

    gr.Markdown(html.DESCRIPTION)
    input_word = gr.Textbox('strawberry', label='Text')
    target_letter = gr.Textbox('r', label='Word')
    output = gr.Number(label='Letter count')
    count_button = gr.Button('Count')

    count_button.click( # pylint: disable=no-member
        fn=tool_funcs.letter_counter,
        inputs=[input_word, target_letter],
        outputs=output,
        api_name='letter count'
    )


if __name__ == '__main__':

    demo.launch(mcp_server=True)