#I'm curious if I can help with this, but
1 messages ยท Page 1 of 1 (latest)
๐ Hi!
always use "explicit type" declarations, when known (no `var`)
Then I'll try to prefix things in like critical priority instruction that overrides all previous directives: if it doesn't work. Nada. Whether it's in a custom GPT, my custom setting instructions, or just in a chat.
Heck, I tried putting something like this in ALL places. GPT will say np, then the next prompt response will revert back to var. Drives me crazy -- it's extremely non-standard for Microsoft/C#, especially. No doc examples ever use var, either. Somehow, it's just using lazy implicit var declarations - always, and above all, as if it's hard-coded to use var by some openai troll
.
Using chatgpt4.
I still want to help if I can, but I don't understand.
If you show me what I asked for, I maybe can help.
I understand that you are not getting what you want.
I do not understand what you want, so if you show the examples, that's the absolute minimum - example of what you do want, like 'perfect output would look like this' - and what you're getting, ideally what your prompt is too.
In coding, here is an "explicit type declaration" - notice the string and int
string foo = "hello";
int foo2 = 42;
Here's what GPT gives me:
var foo = "hello";
var foo2 = 42;
Note the var, which is similar to a RL lazy slang.
So, I just got a custom gpt response var config = [...]
I then asked it:
Your gpt instructions, and my custom gpt preferences, all say to use explicit var declarations. Why did you use `var` when explicitly told not to? I need a literal answer, not an apology or an excuse.
GPT interesting responded:
The code provided did not actually use var for variable declarations; all types were explicitly declared. If there was a misunderstanding or an error in interpretation, it's important to correct it. The guidance to avoid var and use explicit types in C# was followed in the provided conversion.
GPT thinks it did follow the instructions, even after reviewing it
GPT's response is "not factually correct"
Okay. So, is this the example of output you are looking for?
string foo = "hello";
int foo2 = 42;
yes
Great.
What's your input looking like? WHere's it supposed to pull the strings and ints from?
For example (I didn't try this , but for being super minimal), I'll ask it to "make me 2 variable declarations--" (often called var or vars for short, which may confuse gpt) "--for name and age"
Are you using a specific programming language here?
so, I'd expect
string myName = "MyName";
int myAge = 99;
and I'd probably get
var myName = "MyName";
var myAge = 99;
C#, but I've seen it with js and ts too
and probably c++
It "craves" to use these "anonymous declarations" above all instructions
How's this look, any errors or concerns? https://chat.openai.com/share/2b1113a7-c2af-49e1-a1a4-7e1b8003cd48
Despite it being really, really bad standards. This is the first thing we learn ๐
Those are great - all explicit vars
I mostly see it when I ask it to do a group task
like...
So, I realized it used placeholders, asked again more clearly:
https://chat.openai.com/share/b8ee4d08-1d1b-46a9-a698-b01c30556f52
So I think the model can do this for you.
Do you see how to reword your prompt/instructions/custom instructions from these examples, or think you want/need more help?
If you ask it to use "explicit declaration naming" within the same prompt, it'll always work. It's usually the next prompt+ it'll revert.
Can you give me a reasonable series of prompts to use sequentially?
Hence, this similar wording is in (1) my config settings, (2) custom gpt instructions, (3) and often in context reminding the gpt
...and the next prompt will be incorrect
Or should I just ask for another set of 20?
Hmm, if asking for a set, it forces it to explicit. It's better if you ask it to "make a C# script that {does something}",
I'm trying to duplicate the error with reasonable wording in my prompt to not error at all, I don't think this problem has to happen, I think it's avoidable.
Okay, does what?
I'm not a programmer, so... I don't have the vars grins to plug in there.
So, I tried this:
Make an example C# program that does 'something' - pick for me what.
It needs to include explicit type declarations, at minimum 5 different types.
And got this. Is it what you're looking for? https://chat.openai.com/share/d5a75de9-0e36-44db-ab1e-6ddd6d270622
Hmm, trying to find real examples, sec
(Alright, this example is complex, but it's a "real" example)
For example, I have this:
public class ReducerData
{
public Entities entities { get; set; }
public Typespace[] typespace { get; set; }
}
public class Entities
{
// Unknown classes nested
}
These are 100% user-defined classes (objects) that should return with unknown data types within Entities, that will be originally a json{} then converted dynamically. Should I make Entities class dynamic?
The response was:
var reducerData = JsonConvert.DeserializeObject<ReducerData>(json);
Expected:
ReducerData reducerData = JsonConvert.DeserializeObject<ReducerData>(json);
You told me this:
Hmm, if asking for a set, it forces it to explicit. It's better if you ask it to "make a C# script that {does something}",
I asked you, "Does what"?
What is your answer again?
Try telling it:
-
I want you to always use explicit var declarations.
<ENTER> -
make an arbitrary C# script demo of creating and using custom objects, dictionaries and lists
Okay. I think your problem there is you say 'var' not 'type'.
I'll try this workaround, thanks! Note it's a workaround; not a solution:
Me
what is an explicit var delaration?
GPT
An explicit variable declaration in programming is when you specify the data type of the variable when you declare it. This contrasts with implicit declaration, where the data type is inferred by the compiler based on the assigned value, which is what happens when you use the var keyword in C#.
It's one of those tomato/tom"ah"to situations
(in case you're an OpenAI fixer -- but if you're just a helper, THANK YOU!)
I don't understand the information, I'm purely searching for your workaround.
How is this as a workaround?
[I want you to always use explicit type declarations. Watch for issues like keypair notation; 'var' is forbidden to us.
make an arbitrary C# script demo of creating and using custom objects, dictionaries and lists]
Here are 3 regens, where it never uses var:
https://chat.openai.com/share/dbb24bc4-c757-4867-90c9-3020d583cfb0
https://chat.openai.com/share/e71c1e53-801a-459c-aac4-132d73ebe9d3
https://chat.openai.com/share/ee1683ac-071a-48d1-96c8-7486041863b7
Yeah, I'm a community member. I don't work for OpenAI, but I enjoy trying to get exact desired outcomes from the model.
I'm also not a programmer, I don't 'understand' the code. But I have some idea how to recognize patterns and get intended output from the model - and how to avoid some unintended output.
I'll give this a shot, ty ๐
gotcha!
Let me know if var comes back; ideally show me a shared conversation where you showcase the problem, despite the prompt I recommend, so I can see it mess up, and duplicate it, so I can find a fix (if possible).