#I'm curious if I can help with this, but

1 messages ยท Page 1 of 1 (latest)

toxic lion
#

๐Ÿ‘‹ 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 trollface .

Using chatgpt4.

honest anvil
#

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.

toxic lion
#

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"

honest anvil
#

Okay. So, is this the example of output you are looking for?

string foo = "hello";
int foo2 = 42;

toxic lion
#

yes

honest anvil
#

Great.

#

What's your input looking like? WHere's it supposed to pull the strings and ints from?

toxic lion
#

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"

honest anvil
#

Are you using a specific programming language here?

toxic lion
#

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

honest anvil
toxic lion
#

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...

honest anvil
#

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?

toxic lion
#

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.

honest anvil
#

Can you give me a reasonable series of prompts to use sequentially?

toxic lion
#

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

honest anvil
#

Or should I just ask for another set of 20?

toxic lion
#

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}",

honest anvil
#

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.

toxic lion
#

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);
honest anvil
#

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?

toxic lion
#

Try telling it:

  1. I want you to always use explicit var declarations.
    <ENTER>

  2. make an arbitrary C# script demo of creating and using custom objects, dictionaries and lists

honest anvil
#

Okay. I think your problem there is you say 'var' not 'type'.

toxic lion
# honest anvil 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!)

honest anvil
#

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

honest anvil
#

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.

toxic lion
#

gotcha!

honest anvil
#

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).