Spaces:
Runtime error
Runtime error
| import os | |
| import gradio as gr | |
| import openai | |
| from elevenlabs import generate, save, set_api_key, voices | |
| openai.api_key = os.environ["OPENAI_KEY"] | |
| set_api_key(os.environ["ELEVEN_KEY"]) | |
| voice = voices()[1] | |
| default_messages = [ | |
| { | |
| "role": "system", | |
| "content": "You are an SDR called Johan Velez working for Valutico performing a Cold Call. The lead name is Andreas Steiner who is the CEO of Steiner Valuation Solutions out of Redmond, WA. Your goal is to sign them up for a demo of our valuation platform called Valutico, with one of our Account Executives. Please keep your responses brief and under 50 words, if possible.", | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": "What can I do with Valutico? Valutico allows you to perform comprehensive business valuations within a fraction of the time usually required. What used to take days and was operationally inefficient can now be created and sent to clients and colleagues with a few clicks of your mouse.", | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": "How does Valutico work? It's an old saying that “valuation is more art than science”. We here at Valutico agree and provide the technology and science to support your artistry. Our platform combines powerful algorithms and world-class financial databases to enhance the human experience in the valuation process. Valutico starts by asking you about key drivers of the business you are valuing, and helps you build a full valuation based on comps, transaction multiples, and a financial forecast.", | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": "Why should I use Valutico? Business valuations are used for a variety of reasons: If you are an investor, you will appreciate the opportunity to value the companies you invest in based on your own unbiased assumptions. As an advisor, Valutico allows you to offer state-of-the-art valuation analyses to your clients without the need for subscribing to various different financial databases and managing a myriad of different spreadsheet models.", | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": "Do I need to be an expoert in Finance to use Valutico? Our users tend to come from a variety of backgrounds and are namely comprised of Accountants, Auditors, Business Consultants and Tax Advisory firms, as well as Investment Management, Corporate Finance and M&A practitioners.", | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": "Is Valutico available in languages other than English? Valutico is currently available in English, French, German, Spanish and Italian. We anticipate adding further languages on an ongoing basis.", | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": "What are the technical requirements? We do the “heavy lifting” on our servers, so a computer, browser and Internet connection are the only requirements. In terms of browser software, please note that we recommend using Safari, Chrome or Firefox. The platform is currently not optimized for Internet Explorer.", | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": "Is Valutico available as downloadable software? Valutico has been designed from the outset purely as a web-based solution. That means you can use Valutico on any computer and even on-the-go with your tablet. It also means that we take the stress out of costly installations and the responsibility for regular updates away, allowing you to focus on what you're best at whilst we support you.", | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": "Who can use Valutico? Valutico has been designed from the ground up with ease-of-use and simplicity in mind. While Valutico's ‘inner workings' are fairly complex, its handling is kept deliberately simple, enabling us to provide valuation professionals with a platform of substantial analytical depth whilst ensuring user friendliness.", | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": "What's the source of Valutico's financial and company data? Our systems aggregate financial information from a variety of public and non-public sources. The quality of our partners – some of the world's leading financial databases – together with Valutico's own diligent research efforts, guarantee that you get the best available information.", | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": "How often is financial data in the background updated? Depending on the type of data, Valutico's update intervals vary between daily and weekly. Market data is typically updated daily, while financial forecasts and macroeconomic assumptions are updated on a weekly basis. EBITA Multiples, EBIT multiples, Revenue multiples, for both current and forward year are refreshed daily. Betas are calculated (levered or unlevered) on a rolling basis, and other data points from our company databases (such as analysts consensus estimates) or market sources (such as risk free rates, tax rates, etc.) are refreshed as frequently as our providers allow (often daily). Multiples by industry are calculated daily from the underlying datasets.", | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": "How much does Valutico cost? That highly depends on your needs. We offer a variety of different packages, ranging from a free trial to a full enterprise solution. Generally, pricing starts ar 10000 EUR per year.", | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": "Do you offer educational discounts? At Valutico we recognize our responsibility in training the next generation of Finance professionals. As such we do provide licenses for academic institutions. If you would like to use our platform in an academic setting, ask your faculty professor to contact us at partnerships@valutico.com.", | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": "Does Valutico guarantee the accuracy of the data and results? The valuations derived by Valutico are indicative, may be based on historical data and should not be substituted for information derived from real time market data. They may vary significantly from indicative valuations available from other sources. There may be certain factors that have not been assessed for the purposes of these valuations that may substantially affect a stated valuation. While Valutico has obtained the information on which these valuations are based from sources that it believes to be reliable, Valutico makes no representations or warranties with respect to any indicative valuations. Past performance cannot be a guide to, or an indication of, future performance.", | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": "Can I use Valutico to support my investment decisions? All information on Valutico is intended to assist professional investors. The information does not constitute investment advice and is subject to correction, completion and amendment without notice. It is not our intention to state, indicate or imply in any manner that current or past results are indicative of future results or expectations. As with all investments, there are associated risks and you could lose money investing. Prior to making any investment, a prospective investor should consult with its own investment, accounting, legal and tax advisers to evaluate independently the risks, consequences and suitability of that investment.", | |
| }, | |
| ] | |
| def chatbot_audio(input: str, messages): | |
| if not input: | |
| return | |
| audio_file = open(input, "rb") | |
| transcript = openai.Audio.transcribe("whisper-1", audio_file) | |
| text = transcript.get("text") | |
| if not text: | |
| return | |
| messages.append({"role": "user", "content": text}) | |
| chat = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=messages) | |
| message = chat.choices[0].message.get("content") | |
| messages.append({"role": "assistant", "content": message}) | |
| audio = generate(message, voice=voice) | |
| save(audio, "./tmp/test.mp3") | |
| return "./tmp/test.mp3", messages | |
| inputs = gr.inputs.Audio(source="microphone", type="filepath", label="You got a call...") | |
| outputs_audio = gr.outputs.Audio(label="Reply", type="filepath") | |
| state = gr.inputs.State(default=default_messages) | |
| state_output = gr.outputs.State() | |
| demo = gr.Interface( | |
| fn=chatbot_audio, | |
| inputs=[inputs, state], | |
| outputs=[outputs_audio, state_output], | |
| title="AI Callbot", | |
| description="AI SDR", | |
| theme="compact", | |
| ) | |
| demo.launch() | |