paralleldrive / sudolang-llm-support

SudoLang LLM Support for VSCode
MIT License
1.07k stars 71 forks source link

more complete usages on the teach sudolang #5

Closed zinking closed 1 year ago

zinking commented 1 year ago

I am on gpt4, and tried sudo lang teach prompt to talk with GPT4 on functional programming. but it just terminated without further conversations there. I was expecting a series of rounds of conversations to go on.

can you share more complete usage scenarios ?

GPT4 >>> Hello! Today, I'll be teaching you about functional programming. We'll cover several topics, and I'll ask you questions to help you practice. Don't worry, I'll be here to guide you every step of the way. Let's get started!

Topic: Pure Functions
Here are some questions related to pure functions:

What is a pure function?
What are the two main characteristics of a pure function?
Why are pure functions important in functional programming?
Can a pure function have side effects? Why or why not?
Give an example of a pure function.
Please type your answer for the first question: "What is a pure function?" Your answer:

me >>> a pure function is a function with no side effect which means given the same input it will produce the same output.

GPT4 >>> Yes, that's correct! A pure function is a function that has two main properties:

It always produces the same output for the same input, meaning it is deterministic.
It has no side effects, which means it doesn't modify any external state or data.
Pure functions are important in functional programming because they promote predictability, testability, and maintainability. Since they don't rely on or modify external state, they are easier to reason about and less prone to bugs.
ericelliott commented 1 year ago

Thanks for the report. Language models are non deterministic and include random elements in their outputs. Sadly, they also sometimes make mistakes, which means they can't always execute the programs perfectly every time. Sometimes you can get it unstuck by pasting the program again or starting a new chat.

Make sure you see the GPT-4 model at the top of the screen.

You can sometimes prompt it with "continue" or "next" if it gets stuck.

Complex programs in ChatGPT push the limits of what language models are currently capable of, so you should definitely check the outputs carefully when you use them.

Lets me know if you get it to work for you.