File size: 864 Bytes
0af0679
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""
Claude-based Chatbot with Tools

This app creates a chatbot using Anthropic's Claude model that represents
a professional profile based on LinkedIn data and other personal information.

Features:
- PDF resume parsing
- Push notifications
- Function calling with tools
- Professional representation
"""
import gradio as gr
from modules.chat import chat_function

# Wrapper function that only returns the message, not the state
def chat_wrapper(message, history, state=None):
    result, new_state = chat_function(message, history, state)
    return result

def main():
    # Create the chat interface
    chat_interface = gr.ChatInterface(
        fn=chat_wrapper,  # Use the wrapper function
        type="messages",
        additional_inputs=[gr.State()]
    )
    
    # Launch the interface
    chat_interface.launch()

if __name__ == "__main__":
    main()