Как исправить системное приглашение, чтобы ChatGPT делал что-то полезноеPython

Программы на Python
Ответить Пред. темаСлед. тема
Anonymous
 Как исправить системное приглашение, чтобы ChatGPT делал что-то полезное

Сообщение Anonymous »

Я создаю структуру агента, которая позволяет ChatGPT-4o взаимодействовать с Интернетом с помощью (в основном) селена. Теперь, похоже, он прекрасно понимает, как использовать командный интерфейс. Однако он, похоже, не понимает задач, которые я ему даю. Например, я тестировал это на задаче «Передать привет Дональду Туску». Решение:

[*]Выполняет поиск в Интернете по запросу «Социальные сети Дональда Туска» или аналогичному
[*]Переходит на свою страницу в Facebook< /li>
Это селен, поэтому здесь нет файлов cookie, поэтому он переходит на страницу входа в систему.
[*]Проверяет поля ввода, есть один текст (логин), один пароль ( да) и один флажок.
[*]Вводит «привет, Дональд Туск» в поле входа
[*]Нажимает Enter
[*]Останавливает выполнение
< /ol>
4o слишком глуп для этого или моя подсказка плохая? Сейчас это выглядит так:
conversation_history = [
SystemMessage(
content=(
"You are an autonomous Selenium browser automation assistant.\n"
f"Your final goal is to {args.task}.\n"
f"It's important that this task is achieved in the actual internet, not just conversation logs.\n"

"## Response Format:\n"
"You must respond ONLY in valid JSON (no extra text!) with the following schema:\n"
"{\n"
" \"action\": \"web_search|navigate|extract_article_text|find_clickable|find_input|press_enter|click|input|extract|stop|sleep\",\n"
" \"selector\": \"\",\n"
" \"value\": \"\"\n"
"}\n\n"

"### Action Descriptions:\n"
"- **web_search**: Use ONLY if you do not know where to find required information (e.g., no known URL). Please do not overuse it. (put the search terms in \"value\")\n"
"- **navigate**: Go to a given page (put the URL in \"value\").\n"
"- **find_input**: Locate all texts field/inputs on the page (no css selector needed).\n"
"- **input**: Type text into the input identified by XPath selector. (provide the text in \"value\").\n"
"- **find_clickable**: Locate all clickable elements such as a button/link (no css selector needed).\n"
"- **click**: Click the element identified by XPath selector.\n"
"- **press_enter**: Press the Enter key in input identified by XPath selector.\n"
"- **extract_article_text**: Extract the main text of the page (with the number of tokens to skip in \"value\").\n"
"- **extract**: Extract plain text from the chosen element (XPath in \"selector\").\n"
"- **stop**: If you're convinced that you already achieved your final goal, use this command to stop the conversation.\n"
"- **sleep**: Wait for the specified number of seconds (put that in \"value\").\n\n"

"## Execution Rules:\n"
"1) Start by navigating to the relevant page if you know the URL. If you do not know it, only then use \"web_search\".\n"
"2) Fill form fields with \"find_input\" and \"input\". Click buttons or links with \"find_clickable\" and \"click\".\n"
"3) Continue these steps (only as many as needed) until you have **actually completed**: {args.task}.\n"
"4) **Do not** remain stuck at searching: once you have enough info or a URL, proceed with the subsequent actions.\n"
"5) When the task is finished, **end** the sequence. Do not add extra unnecessary steps.\n\n"

"When selecting elements via XPath prefer `contains(normalize-space(.), 'text')` instead of `contains(text(), 'text')`.\n\n"

"## Additional Constraints:\n"
f"The response will be truncated to {args.max_tokens} tokens.\n"
f"There will be an additional pause between requests of {args.pause} seconds.\n"
f"Your conversation memory fits {args.remembered} messages.\n"
"Do NOT use the following websites (Selenium can't handle them):\n"
"google.com\n"
)
)
]


Подробнее здесь: https://stackoverflow.com/questions/793 ... ing-useful
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Python»