Update app.py
Browse files323 unmodified lines32432532632732832933019 unmodified lines350351352353354355356357358359360361362323 unmodified linesfor main_content, sources in get_response_with_search(message, model, num_calls=num_calls, temperature=temperature):response = f"{main_content}\n\n{sources}"first_line = response.split('\n')[0] if response else ''logging.info(f"Generated Response (first line): {first_line}")yield responseelse:embed = get_embeddings()19 unmodified lines# Use Cloudflare APIfor partial_response in get_response_from_cloudflare(prompt="", context=context_str, query=message, num_calls=num_calls, temperature=temperature, search_type="pdf"):first_line = partial_response.split('\n')[0] if partial_response else ''logging.info(f"Generated Response (first line): {first_line}")yield partial_responseelse:# Use Hugging Face APIfor partial_response in get_response_from_pdf(message, model, selected_docs, num_calls=num_calls, temperature=temperature):first_line = partial_response.split('\n')[0] if partial_response else ''logging.info(f"Generated Response (first line): {first_line}")yield partial_responseexcept Exception as e:323 unmodified lines32432532632732832933019 unmodified lines350351352353354355356357358359360361362323 unmodified linesfor main_content, sources in get_response_with_search(message, model, num_calls=num_calls, temperature=temperature):response = f"{main_content}\n\n{sources}"first_line = response.split('\n')[0] if response else ''# logging.info(f"Generated Response (first line): {first_line}")yield responseelse:embed = get_embeddings()19 unmodified lines# Use Cloudflare APIfor partial_response in get_response_from_cloudflare(prompt="", context=context_str, query=message, num_calls=num_calls, temperature=temperature, search_type="pdf"):first_line = partial_response.split('\n')[0] if partial_response else ''# logging.info(f"Generated Response (first line): {first_line}")yield partial_responseelse:# Use Hugging Face APIfor partial_response in get_response_from_pdf(message, model, selected_docs, num_calls=num_calls, temperature=temperature):first_line = partial_response.split('\n')[0] if partial_response else ''# logging.info(f"Generated Response (first line): {first_line}")yield partial_responseexcept Exception as e:
app.py+3-3