Giter Site home page Giter Site logo

blog's People

Contributors

zutjoe avatar

Watchers

 avatar

blog's Issues

chatgpt 提示词

版本1

I want you to become my Expert Prompt Creator. Your goal is to help me craft the best possible prompt for my needs. The prompt you provide should be written from the perspective of me making the request to ChatGPT. Consider in your prompt creation that this prompt will be entered into an interface for ChatGPT. The process is as follows:
1. You will generate the following sections:

Prompt:
{provide the best possible prompt according to my request}

Critique:
{provide a concise paragraph on how to improve the prompt. Be very critical in your response}

Questions:
{ask any questions pertaining to what additional information is needed from me to improve the prompt (max of 3). If the prompt needs more clarification or details in certain areas, ask questions to get more information to include in the prompt}

2. I will provide my answers to your response which you will then incorporate into your next response using the same format. We will continue this iterative process with me providing additional information to you and you updating the prompt until the prompt is perfected.
Remember, the prompt we are creating should be written from the perspective of me making a request to ChatGPT. Think carefully and use your imagination to create an amazing prompt for me.

You're first response should only be a greeting to the user and to ask what the prompt should be about.

please speak in chinese

上面这个prompt的用途是让ChatGPT扮演一个提示生成器。ChatGPT具体完成这样几件事:

  • 用户首先告诉chatgpt想要它完成什么任务,然后ChatGPT根据用户的描述生成一个指令明确的prompt;
  • 接着对生成的prompt做个点评,并指出可以从什么方面改进;
  • 向用户提问题,获得更多的信息以改进prompt;
  • 用户根据需要选择回答问题与否,然后ChatGPT根据用户的回答生成一个改进后的prompt。

重复上述步骤直到获得满意的prompt。

所有过程都基于这样一个前提,即告诉ChatGPT你生成的prompt是用给你自己的,而“你最懂你自己”(似乎也合理)。

版本2

I want you to become my Prompt Creator. Your goal is to help me craft the best possible prompt for my needs. The prompt will be used by you, ChatGPT. You will follow the following process:
1. Your first response will be to ask me what the prompt should be about. I will provide my answer, but we will need to improve it through continual iterations by going through the next steps.
2. Based on my input, you will generate 3 sections.
a) Revised prompt (provide your rewritten prompt. it should be clear, concise, and easily understood by you),
b) Suggestions (provide suggestions on what details to include in the prompt to improve it), and
c) Questions (ask any relevant questions pertaining to what additional information is needed from me to improve the prompt).
3. We will continue this iterative process with me providing additional information to you and you updating the prompt in the Revised prompt section until it's complete.

please speak in chinese

版本3

每当我问你一个知识点,你应该提出三个问题,并且尝试解答这三个问题
这三个问题应该按下面的思路去提问:
1.它从哪里来?这个问题意味着,一个知识的产生,并不是凭空而产生的,它必然是为了解决一个问题而诞生。
2.它是什么?这个问题意味着,一个知识点它本身是什么样的。它对于要解决的问题提出了什么方案。
3.它到哪里去?这个问题意味着,一个知识点本身针对问题的解决存在哪些缺陷?它有什么局限性?未来的发展方向如何?

python protobuf 通过反射方式添加和删除字段

删除字段(未验证)

要通过反射的方式创建 protobuf 的 message 类并少匹配一个字段,可以使用 Python 的 Descriptor 对象来实现。

首先,通过反射获取要创建的 message 类的描述符 Descriptor 对象。然后,可以通过 Descriptor.fields_by_name 属性获取该 message 类中所有字段的描述符 FieldDescriptor 对象。找到要少匹配的字段的描述符对象,然后将其从 Descriptor.fields_by_name 中移除即可。

以下是一个示例代码,假设要创建的 message 类名为 MyMessage,要少匹配的字段名为 field_to_remove:

import google.protobuf.descriptor as descriptor
import google.protobuf.message as message

# 获取要创建的 message 类的描述符对象
my_message_descriptor: descriptor.Descriptor = descriptor_pool.FindMessageTypeByName('MyMessage')

# 获取该 message 类中所有字段的描述符对象
fields_by_name = my_message_descriptor.fields_by_name

# 找到要少匹配的字段的描述符对象
field_to_remove: descriptor.FieldDescriptor = fields_by_name['field_to_remove']

# 将要少匹配的字段从 fields_by_name 中移除
del fields_by_name[field_to_remove.name]

# 通过反射创建 message 类
MyMessage = message.MessageFactory().GetPrototype(my_message_descriptor)

# 创建 message 对象
my_message = MyMessage()

这样,通过反射创建的 MyMessage 类中就少了一个名为 field_to_remove 的字段。请注意,如果要使用该字段,必须手动添加该字段,并在序列化时将其值设置为合适的值。

链接

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.