Anyone Get ChatGPT4 to work with ZP?

leadssolution

Новичок
Регистрация
13.06.2016
Сообщения
12
Благодарностей
2
Баллы
3
I have seen several threads about this subject but no real final conclusion.
I have managed to get it to the point of sending the post request, but when using a variable the JSON is malformed.
I get this:

{
"error": {
"message": "We could not parse the JSON body of your request. (HINT: This likely means you aren't using your HTTP library correctly. The OpenAI API expects a JSON payload, but what was sent was not valid JSON. If you have trouble figuring out how to fix this, please contact us through our help center at help.openai.com.)",
"type": "invalid_request_error",
"param": null,
"code": null
}
}

Without the variable placeholder it sends the request. Any ideas on how to get this working?
{
"model": "gpt-4",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant. Your task is to extract information from the given text."
},
{
"role": "user",
"content": "Find the first and last name in this text: {-Variable.prompt-}" (I have tried wording this many different ways)
}
],
"temperature": 0.5,
"max_tokens": 3200
}
 

Pierre Paul Jacques

Активный пользователь
Регистрация
08.10.2023
Сообщения
123
Благодарностей
33
Баллы
28
Hi Lead Solution
I don't have acces to GTP 4 by api right now
but with 3.5 it's work this code :

{
"model": "gpt-3.5-turbo-1106",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant. Your task is to extract information from the given text."
},
{
"role": "user",
"content": "Find the first and last name in this text : {-Variable.prompt-} is going to the beach "
}
],
"temperature": 0.5,
"max_tokens": 3200
}
I just try it and it works,)
GPT 3.5 or 4 shouldn't make difference about the zeno variable, it is strange!


113914

113916
 
  • Спасибо
Реакции: leadssolution

leadssolution

Новичок
Регистрация
13.06.2016
Сообщения
12
Благодарностей
2
Баллы
3
Strange Indeed. The only thing I can figure is the variable is not in JSON format.
Here's an example of the variable:

Debtor Name ARMSTRONG, LESBIE
Debtor Address 780 EL PASO ST, LA MEA, CA 91942
Debtor Name KLING, ERIK
Debtor Address 7830 EL PAS ST, LA MEA, CA 91942
Secured Party Name SUNPOW CAPITAL SERVICES LLC
Secured Party Address 890 AMBER BOULEVARD, AUSTIN, TX 78789

I tried using C# to change the variable into a formatted string, but have not figured out how yet.
 
  • Спасибо
Реакции: Pierre Paul Jacques

myndeswx

Client
Регистрация
15.05.2017
Сообщения
406
Благодарностей
92
Баллы
28
That's a really annoying issue, good thing that zenno has our back!

C#:
string ob = project.Variables["aiPromptTex"].Value;
string json = Global.ZennoLab.Json.JsonConvert.ToString(ob);
return json;
 

Вложения

leadssolution

Новичок
Регистрация
13.06.2016
Сообщения
12
Благодарностей
2
Баллы
3
Amazing. Thank you. Is this in the documentation somewhere? I looked everywhere for this answer.
 
  • Спасибо
Реакции: myndeswx

myndeswx

Client
Регистрация
15.05.2017
Сообщения
406
Благодарностей
92
Баллы
28
It's inbuilt in the Newtonsoft that zenno uses for JSON parsing
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)