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

feat: add dashscope as llm #102

Merged
merged 1 commit into from Oct 9, 2023
Merged

feat: add dashscope as llm #102

merged 1 commit into from Oct 9, 2023

Conversation

Abirdcfly
Copy link
Collaborator

For #101

test for model qwen-14b-chat and qwen-7b-chat(通义千问开源 7B、14B 模型), common http request and sse enable.

output gif:
CleanShot 2023-10-08 at 17 35 44

full output

Details
go run ./examples/dashscope  sk-xxxxxx

I1008 17:35:49.323001    1081 main.go:37] sample chat start...
we use same prompt: how to change a deployment's image? to test
I1008 17:35:49.323547    1081 main.go:39]
Chat with qwen-14b-chat
I1008 17:35:56.857960    1081 main.go:44] Response:
 {"output":{"choices":[{"finish_reason":"stop","message":{"role":"assistant","content":"To change the image of a deployment in Kubernetes, you can use the `kubectl set image` command. For example, if you have a deployment named `my-deployment` and you want to change the image to `my-image:latest`, you can use the following command:\n```\nkubectl set image deployment/my-deployment my-container=my-image:latest\n```\n\nThis will update the image of the deployment's `my-container` container to the specified image.\nYou can also use the `kubectl edit` command to edit the deployment's configuration directly. This will open the deployment's configuration in your default text editor, where you can update the image and other settings.\nFor example, you can use the following command to edit the `my-deployment` deployment:\n```\nkubectl edit deployment/my-deployment\n```\n\nThis will open the deployment's configuration in your default text editor, where you can update the image and other settings. Once you have made your changes, save the file and exit the editor. The changes will be applied to the deployment.\nYou can also use the `kubectl replace` command to update the deployment's configuration with a new YAML file. For example, you can use the following command to replace the `my-deployment` deployment with a new configuration:\n```\nkubectl replace -f my-deployment.yaml\n```\n\nThis will apply the changes in the `my-deployment.yaml` file to the `my-deployment` deployment. You can create the `my-deployment.yaml` file by using the `kubectl get deployment` command to retrieve the current deployment configuration, making the necessary changes, and then saving the updated configuration to a file."}}]},"usage":{"output_tokens":334,"input_tokens":15},"request_id":"777973d7-fa18-9eaa-9735-4a55103a6c25"}
I1008 17:35:56.858105    1081 main.go:45]
Chat again with sse enable
To change the image of a deployment in Kubernetes, you can use the `kubectl set image` command. For example, if you have a deployment named `my-deployment` and you want to change the image to `my-image:latest`, you can use the following command:

kubectl set image deployment/my-deployment my-container=my-image:latest


This will update the image of the deployment's `my-container` container to the specified image.
You can also use the `kubectl edit` command to edit the deployment's configuration directly. This will open the deployment's configuration in your default text editor, where you can update the image and other settings.
For example, you can use the following command to edit the `my-deployment` deployment:

kubectl edit deployment/my-deployment


This will open the deployment's configuration in your default text editor, where you can update the image and other settings. Once you have made your changes, save the file and exit the editor. The changes will be applied to the deployment.
You can also use the `kubectl replace` command to update the deployment's configuration with a new YAML file. For example, you can use the following command to replace the `my-deployment` deployment with a new configuration:

kubectl replace -f my-deployment.yaml


This will apply the changes in the `my-deployment.yaml` file to the `my-deployment` deployment. You can create the `my-deployment.yaml` file by using the `kubectl get deployment` command to retrieve the current deployment configuration, making the necessary changes, and then saving the updated configuration to a file.I1008 17:36:04.553010    1081 main.go:39]
Chat with qwen-7b-chat
I1008 17:36:08.192128    1081 main.go:44] Response:
 {"output":{"choices":[{"finish_reason":"stop","message":{"role":"assistant","content":"To change the image of a deployment in Kubernetes, you can use the `kubectl set image` command. Here's an example of how to do it:\n\n  1. First, identify the deployment you want to update by its name or by using the `kubectl get deployments` command to list all deployments in your cluster.\n  2. Once you have identified the deployment, use the `kubectl set image` command to update the image of the deployment. The command takes the following format:\n\n```\nkubectl set image deployment/\u003cdeployment-name\u003e \u003cimage-name\u003e:\u003ctag\u003e\n```\n\nFor example, if you want to update the deployment named `my-deployment` to use the `nginx:1.17` image, you would use the following command:\n\n```\nkubectl set image deployment/my-deployment nginx:1.17\n```\n\nNote that you can also specify the `--force` flag to update the deployment immediately, without waiting for it to be scheduled. This can be useful if you need to update the deployment quickly, but you don't want to risk downtime.\n\n```\nkubectl set image deployment/my-deployment nginx:1.17 --force\n```"}}]},"usage":{"output_tokens":239,"input_tokens":15},"request_id":"b8b19917-85db-911d-8dc3-03a4874a3735"}
I1008 17:36:08.192342    1081 main.go:45]
Chat again with sse enable
To change the image of a deployment in Kubernetes, you can use the `kubectl set image` command. Here's an example of how to do it:

  1. First, identify the deployment you want to update by its name or by using the `kubectl get deployments` command to list all deployments in your cluster.
  2. Once you have identified the deployment, use the `kubectl set image` command to update the image of the deployment. The command takes the following format:

kubectl set image deployment/ :


For example, if you want to update the deployment named `my-deployment` to use the `nginx:1.17` image, you would use the following command:

kubectl set image deployment/my-deployment nginx:1.17


Note that you can also specify the `--force` flag to update the deployment immediately, without waiting for it to be scheduled. This can be useful if you need to update the deployment quickly, but you don't want to risk downtime.

kubectl set image deployment/my-deployment nginx:1.17 --force



const (
QWEN14BChat Model = "qwen-14b-chat"
QWEN7BChat Model = "qwen-7b-chat"
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this embedding service as well

sure, I will add embedding from another pr.

Signed-off-by: Abirdcfly <fp544037857@gmail.com>
@bjwswang bjwswang merged commit 2484b8e into kubeagi:main Oct 9, 2023
4 checks passed
nkwangleiGIT pushed a commit to nkwangleiGIT/arcadia that referenced this pull request Dec 1, 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.

None yet

2 participants