Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add SKIP_TRIGGER_KEY_WORD, SKIP_SEND_TO_OpenAI_KEYWORDS #36

Closed
wants to merge 4 commits into from

Conversation

pjq
Copy link
Collaborator

@pjq pjq commented Mar 2, 2023

添加两个参数

  1. SKIP_TRIGGER_KEY_WORD, 相当于开启沉浸式对话模式
  2. SKIP_SEND_TO_OpenAI_KEYWORDS, 一些特殊命令,不需要发送给OpenAI.

@yihong0618 你看看,需不需要

@yihong0618
Copy link
Owner

可以,我晚上看下,下午要干活了

@pjq
Copy link
Collaborator Author

pjq commented Mar 2, 2023

我还有一个想法,是添加场景定制的,之前我自己定制的就是比如给一个5岁的小孩用, 这样会更有上下文一些。
只需要启动的时候发过去

@pjq pjq force-pushed the main branch 2 times, most recently from 6ae1508 to 625c98e Compare March 2, 2023 11:32
@yihong0618
Copy link
Owner

@pjq 定制场景的我们得设计下。你先开个 issue?

@pjq
Copy link
Collaborator Author

pjq commented Mar 2, 2023

@pjq pjq force-pushed the main branch 2 times, most recently from 38818a1 to b963845 Compare March 2, 2023 14:58
@pjq
Copy link
Collaborator Author

pjq commented Mar 2, 2023

Test done.

@yihong0618
Copy link
Owner

今天先睡了,明天看哈。邀请你作为合作者了。

@yihong0618
Copy link
Owner

yihong0618 commented Mar 2, 2023

今天先睡了,明天看哈。邀请你作为合作者了。

顺序是先合 config -> 然后我测一下这个 PR -> 最后我们一起看看那个提示词 和 #42

@pjq pjq force-pushed the main branch 3 times, most recently from 958369f to d769cb4 Compare March 4, 2023 12:42
@pjq
Copy link
Collaborator Author

pjq commented Mar 4, 2023

Test the following two cases, works well.

  • python3 xiaogpt.py --config myconfig.json
  • python3 xiaogpt.py --hardware LX01 --cli_interactive_mode

@pjq
Copy link
Collaborator Author

pjq commented Mar 4, 2023

@yihong0618 目前新加的black . --check -v 格式化之后还是通过不了

@yihong0618
Copy link
Owner

升级你本地的 black

pip install -U black

@pjq pjq force-pushed the main branch 2 times, most recently from b7fad1d to 5adf2f8 Compare March 5, 2023 12:46
@pjq
Copy link
Collaborator Author

pjq commented Mar 5, 2023

Fix the code conflicts
And the ENABLE_IMMERSIVE_TALKING_MODE logic as follows, skip the KEY_WORD check.

                    if ENABLE_IMMERSIVE_TALKING_MODE:
                        print(f"ENABLE_IMMERSIVE_TALKING_MODE: {query}")
                    else:
                        if query.find(KEY_WORD) != -1:
                            # only mute when your clause start's with the keyword
                            if self.this_mute_xiaoai:
                                await self.stop_if_xiaoai_is_playing()
                            self.this_mute_xiaoai = False
                            # drop 帮我回答
                            query = query.replace(KEY_WORD, "")
                        else:
                            continue

@yihong0618
Copy link
Owner

will take a look later

@yihong0618
Copy link
Owner

will merge and seems we need to refactor the code in the future.

@yihong0618
Copy link
Owner

yihong0618 commented Mar 7, 2023

not work...
image

@pjq
Copy link
Collaborator Author

pjq commented Mar 7, 2023

not work... image

It's working
image

It seems you're not enable the immersive talking mode, or you can type begin "帮我"

  "ENABLE_IMMERSIVE_TALKING_MODE": true,
    "PROMPT": "",
    "KEYWORDS_AVOID_SEND_TO_OPENAI": ["停止", "播放", "打开", "关闭", "天气"],
    "CLI_INTERACTIVE_MODE": true,

@yihong0618
Copy link
Owner

ENABLE_IMMERSIVE_TALKING_MODE need to set false when we use arg I wonder

@pjq
Copy link
Collaborator Author

pjq commented Mar 7, 2023

Now it's kinds of mess up for the arguments/config/environment/constants.
May need to refine those logic later.

@yihong0618
Copy link
Owner

yep...

pjq added 4 commits March 7, 2023 22:32
add more config field to the config file

rename the fields name

fix PROMPT config

add CLI_INTERACTIVE_MODE params
@yihong0618
Copy link
Owner

等我研究下把这个合了,整理代码。。。

@yihong0618
Copy link
Owner

@pjq closing this since we have supported key words now

@yihong0618 yihong0618 closed this Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants