Is it possible to take user input from gradio.Code and use it as input in gradio.ChatInterface?

150 views Asked by At

I am creating an MVP using Gradio. In the MVP I want to take some user made input from gradio.Code and use it as the input for gradio.ChatInterface, but I cannot seem to find out how to do it with the existing docs.

The ideal solution would be to get the user created input and pass it to the ChatInterface which would read the prompt as something along the lines of "This is my code for {task[i]}. Does it solve the task? If not, give me help on how to solve it, but do not give me the answer."

I am not used to writing Python at all, so this is not my usual area of development and something I am fairly new to.

I already have something in the lines of

with gr.Blocks() as demo: with gr.Row(): code_field = gr.Code(language="python") chat_field = gr.ChatInterface(chat_pdf)

The chat_pdf function takes in input from the users and answers them as gpt4, with additional help from uploaded pdfs using llamaindex.

0

There are 0 answers