Skip to content

Commit fbc4212

Browse files
Added styling and instructions
1 parent 0a60957 commit fbc4212

File tree

8 files changed

+19
-57
lines changed

8 files changed

+19
-57
lines changed

.chainlit/config.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ edit_message = true
3333

3434
# Authorize users to spontaneously upload files with messages
3535
[features.spontaneous_file_upload]
36-
enabled = true
36+
enabled = false
3737
accept = ["*/*"]
3838
max_files = 20
3939
max_size_mb = 500
@@ -54,7 +54,7 @@ edit_message = true
5454

5555
[UI]
5656
# Name of the assistant.
57-
name = "Assistant"
57+
name = "partner"
5858

5959
# Description of the assistant. This is used for HTML tags.
6060
# description = ""
@@ -66,7 +66,7 @@ default_collapse_content = true
6666
cot = "full"
6767

6868
# Link to your github repo. This will add a github button in the UI's header.
69-
# github = ""
69+
github = "https://github.com/Pierre-LouisBJT/yc-interview-prep"
7070

7171
# Specify a CSS file that can be used to customize the user interface.
7272
# The CSS file can be served from the public directory or via an external link.

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# YC interview prep using OpenAI real time API
22

3+
> This is a personal project. It is not affiliated with the Y Combinator in any way.
4+
35
Get ready for that YC interview!

app.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,14 @@ async def handle_error(event):
6262
openai_realtime.add_tool(tool_def, tool_handler)
6363
for tool_def, tool_handler in tools
6464
]
65+
print("Adding tools")
6566
await asyncio.gather(*coros)
6667

6768

6869
@cl.on_chat_start
6970
async def start():
7071
await cl.Message(
71-
content="Welcome to the Chainlit x OpenAI realtime example. Press `P` to talk!"
72+
content="Welcome to this mock YC interview. Press `P` to talk! No need to type."
7273
).send()
7374
await setup_openai_realtime()
7475

public/avatars/partner.png

83.1 KB
Loading

public/favicon.png

15.5 KB
Loading

public/logo_dark.png

15.5 KB
Loading

public/logo_light.png

15.5 KB
Loading

realtime/tools.py

+12-53
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,27 @@
11
import chainlit as cl
22

3-
query_stock_price_def = {
4-
"name": "query_stock_price",
5-
"description": "Queries the latest stock price information for a given stock symbol.",
3+
give_feedback_on_answer_def = {
4+
"name": "give_feedback_on_answer",
5+
"description": "As a Y Combinator partner, provide a short feedback on the answer the user gave to your question. This function shoudl be called after the user has answered a question.",
66
"parameters": {
77
"type": "object",
88
"properties": {
9-
"symbol": {
9+
"feedback": {
1010
"type": "string",
11-
"description": "The stock symbol to query (e.g., 'AAPL' for Apple Inc.)",
12-
},
13-
"period": {
14-
"type": "string",
15-
"description": "The time period for which to retrieve stock data (e.g., '1d' for one day, '1mo' for one month)",
16-
},
17-
},
18-
"required": ["symbol", "period"],
19-
},
20-
}
21-
22-
23-
async def query_stock_price_handler(symbol, period):
24-
"""
25-
Queries the latest stock price information for a given stock symbol.
26-
"""
27-
try:
28-
return None
29-
30-
except Exception as e:
31-
return {"error": str(e)}
32-
33-
34-
query_stock_price = (query_stock_price_def, query_stock_price_handler)
35-
36-
draw_plotly_chart_def = {
37-
"name": "draw_plotly_chart",
38-
"description": "Draws a Plotly chart based on the provided JSON figure and displays it with an accompanying message.",
39-
"parameters": {
40-
"type": "object",
41-
"properties": {
42-
"message": {
43-
"type": "string",
44-
"description": "The message to display alongside the chart",
45-
},
46-
"plotly_json_fig": {
47-
"type": "string",
48-
"description": "A JSON string representing the Plotly figure to be drawn",
11+
"description": "The feedback to provide to the user",
4912
},
5013
},
51-
"required": ["message", "plotly_json_fig"],
14+
"required": ["feedback"],
5215
},
5316
}
5417

5518

56-
async def draw_plotly_chart_handler(message: str, plotly_json_fig):
57-
fig = None
58-
elements = []
59-
60-
await cl.Message(content=message, elements=elements).send()
61-
19+
async def give_feedback_on_answer_handler(feedback):
20+
print("feedback handler")
21+
print(feedback)
22+
await cl.Message(content=feedback).send()
6223

63-
draw_plotly_chart = (draw_plotly_chart_def, draw_plotly_chart_handler)
6424

25+
give_feedback_on_answer = (give_feedback_on_answer_def, give_feedback_on_answer_handler)
6526

66-
# tools = [query_stock_price, draw_plotly_chart]
67-
# No tools for now
68-
tools = []
27+
tools = [give_feedback_on_answer]

0 commit comments

Comments
 (0)