CoT Reasoning: Chatting with Zephyr 7b Beta#


  • Collaborators:

    • Roberto Rodriguez (@Cyb3rWard0g)

Import Modules#

import openai

Initialize OpenAI Client#

import openai
client = openai.OpenAI(
    api_key="anything",
    base_url="http://127.0.0.1:8000"
)

Define Completion Function#

def get_completion(prompt, model="zephyr-7B-beta"):
    messages = [{"role":"user", "content":prompt}]
    response = client.chat.completions.create(
        model=model,
        messages=messages
    )
    return response.choices[0].message.content

Direct Reasoning#

Define Prompt#

prompt = """
How would I get to Machu Picchu (Peru) from Virginia (USA)?
"""

Run Prompt#

response = get_completion(prompt)
print(response)
Unfortunately, there is no direct flight or land route connecting Virginia in the United States to Machu Picchu in Peru. You'll need to fly from Virginia to a major international airport, such as JFK in New York City, and then connect to a flight to Cusco, Peru (CUZ). From Cusco, you can take a train or bus to the nearby town of Aguas Calientes, where most people stay overnight before visiting Machu Picchu.

Here's an outline of what your travel itinerary might look like:

1. Fly from Virginia (IAD) to JFK (New York City)
2. Stay overnight in New York City or connect to a flight to Cusco (CUZ)
3. Arrive in Cusco and spend a few days acclimatizing to the altitude and exploring the city's many attractions
4. Take a train or bus to Aguas Calientes, where you'll stay overnight before visiting Machu Picchu the next morning
5. Spend a full day exploring Machu Picchu and hiking nearby trails (such as Huayna Picchu)
6. Return to Cusco and continue your travels in Peru or fly back to Virginia (IAD) from there

The total travel time will depend on various factors, including the number of connections needed between Virginia and Cusco, layovers, flight schedules, and any delays that may occur.

Zero-Shot CoT#

Define Prompt#

prompt = """
How would I get to Machu Picchu (Peru) from Virginia (USA)?. Think step by step.
"""

Run Prompt#

response = get_completion(prompt)
print(response)
1. Research flights: First, check for flights from major airports near Virginia (such as Dulles International Airport or Washington Dulles International Airport) to Lima, Peru's capital city. Major airlines that operate flights between these two destinations include American Airlines, Delta Air Lines, and United Airlines.

2. Book your flight: Once you've found a suitable flight, book it online through the airline's website or a travel booking site like Expedia or Kayak. Be sure to consider the cost of the flight, layovers, and connection times.

3. Apply for a Peruvian visa (if required): US citizens do not require a visa for stays in Peru of up to 90 days, but it's always best to double-check the requirements before departing.

4. Arrange transportation from Lima to Cusco: After arriving in Lima, you can take a connecting flight or a bus to Cusco (the closest major city to Machu Picchu). Popular bus companies include Cruz del Sur and Oltursa. Alternatively, you may choose to take the train directly to Aguas Calientes, the nearest town to Machu Picchu.

5. Book accommodations: Cusco is a popular tourist destination, so it's best to book your accommodation ahead of time. Hostels, guesthouses, and hotels are available at various price points.

6. Plan your visit to Machu Picchu: The entrance to Machu Picchu is located in Aguas Calientes. You can either hike the Inca Trail or take a bus up to the site. It's recommended to book your tickets online in advance, as they sell out quickly during peak tourist season.

7. Prepare for the trip: Pack appropriate clothing and gear for the altitude and weather conditions. Consider hiring a guide or taking a tour to make the most of your visit to Machu Picchu. Also, remember to bring plenty of water, sunscreen, and insect repellent.

8. Departure from Cusco: After leaving Machu Picchu, you'll need to return to Cusco before departing Peru. From there, you can take a connecting flight back to Lima or the US. 

This is just a basic overview, but hopefully, it provides a good starting point for planning your trip. Always consult official sources like Peru's government tourism website and the U.S Embassy in Peru for more detailed information regarding visa requirements and safety tips.