File size: 3,225 Bytes
5321b2e
be9f317
5321b2e
 
 
6c00aa7
5321b2e
 
 
abc2a5e
a8f6a3f
abc2a5e
 
 
 
 
5321b2e
b365ccb
5321b2e
abc2a5e
cbb4736
5321b2e
 
 
 
 
 
 
 
 
 
f5caad3
512b6e9
f5caad3
736b4c7
63b3c15
f5caad3
5321b2e
 
 
7ac9bc2
5321b2e
 
 
 
7ac9bc2
5321b2e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
daa4f11
c885ea9
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
RAVEN_GENERATION_KWARGS = {
    "max_new_tokens": 1000,
    "do_sample": False,
    "temperature": 0.001,
    "return_full_text": False,
    "stop_sequences": ["<bot_end>", "Thought:"],
    "stream": True,
}

SUMMARY_MODEL_PROMPT = """<s> [INST] 
For your reference, the current location is {current_location} and the current time is {current_time}.

Search results:
{results}

Please answer the following query using natural language based on the search results provided above with no extra hallucinated content. When there is no relevant information in the search results, please do not answer extra information and answer with "No relevant information". Please be detailed.

Query: {query}


[/INST]"""

SUMMARY_MODEL_GENERATION_KWARGS = {
    "max_new_tokens": 1000,
    "do_sample": False,
    "temperature": 0.001,
    "return_full_text": False,
    "stream": True,
}

EXAMPLE_QUERIES = {
    "Discover Any Locale!": "I want to get the best restaurant in New York and get the reviews",
    "Targeted Insights": "What are people saying about some of the better Austin restaurants?",
    "Re-Discover YOUR Neighborhood": "What are some good tourist areas near me and what are folks telling about some of them?",
    "Tailored Recommendations": "Any golf courses recommended for its scenic views based on reviews in San Francisco?",
    "Compare Feedback": "Can you get me reviews for So Gong Dong Tofu house and Siam Thai Cuisine in San Jose and compare them specifically regarding how tasty the food is? Summarize the answer. Please print the review texts you reference.",
    "Deep Insights": "What's the nearest I need to walk to get some food near Stanford University?",
}

INTRO_TEXT = """
# Google Places API Copilot Demo, Driven by NexusRaven
This demo presents a natural language interface to the Google Places API, showcasing Raven's capability to enable copilots and agents to use software tools. Raven transforms your plain English queries into function calls to your APIs. Type in your query and lets explore wonderful places and recommendations through Raven and the Places API!

πŸ—ΊοΈ Google Places API searches for places of interest and returns information regarding location, reviews, and recommendations.

πŸ¦β€β¬› NexusRaven, our function calling model, will execute the necessary API calls in the backend to get the information you need!

### Examples
"""

CSS = """
footer {
    visibility: hidden;
}
.inner-large-font {
    --text-md: 16px;
    font-size: 20;
}
:root {
    --text-sm: 18px;
    --input-text-size: 18px;
}
.dark {
    --text-sm: 18px;
    --input-text-size: 18px;
}

"""

HEADER_HTML = """<img width="50" height="50" style="float:left; margin: 0px;" src="/file=logo.png">
<h1 style="overflow: hidden; padding-top: 17px; margin: 0px;">Nexusflow</h1>
"""

# Inputs must be encoded via urllib.parse.quote
GMAPS_EMBED_HTML_TEMPLATE = """
<iframe width="100%" height="600" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?width=100%25&amp;height=600&amp;hl=en&amp;q={location}+{address}&amp;t=&amp;z=18&amp;ie=UTF8&amp;iwloc=B&amp;output=embed">
"""

ERROR_MESSAGE = "Sorry, I wasn't able to fulfill your request! Please try again :)"