[新软件] chatgpt ai at termianl (ata, aichat)

date
Jul 18, 2023
slug
newsoftware-chatgpt-ai-terminal
status
Published
summary
新软件-
tags
software
type
Post
URL
 

Summary

    安装过程

    ata - one liner

    brew install ata
    
    	ata --
    vi /Users/tbh9527/Library/Application\ Support/ata.Ask-the-Terminal-Anything-\(ATA\)-Project-Authors.ata/ata.toml
    
    ata
    # 开始对话
    notion image
    notion image
    notion image

    aichat - 可多行对话

    brew install aichat
    
    .info                                                                                                                                         
    config_file         /Users/tbh9527/Library/Application Support/aichat/config.yaml
    roles_file          /Users/tbh9527/Library/Application Support/aichat/roles.yaml ⚠️
    messages_file       /Users/tbh9527/Library/Application Support/aichat/messages.md ⚠️
    api_key             sk-NoLPLDORyV8g--------------67QMp7Nm3NG
    organization_id     -
    model               gpt-3.5-turbo
    temperature         -
    save                true
    highlight           true
    proxy               socks5://127.0.0.1:17890
    conversation_first  false
    light_theme         false
    connect_timeout     10
    dry_run             false
    
    
    cat >> /Users/tbh9527/Library/Application\ Support/aichat/config.yaml <<EOF
    api_key: sk-NoLPLDORyV8g--------------67QMp7Nm3NG
    #organization_id: "org-xxx"        # optional, set organization id
    proxy: socks5://127.0.0.1:17890
    model:              gpt-3.5-turbo
    temperature:        0.3
    conversation_first:  true
    save: true                        # optional, If set true, aichat will save chat messages to message.md
    highlight: true                   # optional, Set false to turn off highlight
    #light_theme: false                # optional, If set true, use light theme
    connect_timeout: 10               # optional, Set a timeout in seconds for connect to gpt.
    EOF
    
    # or 
    
    .set dry_run false
    .set highlight true
    .set save true
    .set temperature 0.4
    
    
    .model gpt-4
    # .model gpt-4-32k
    # .model gpt-3.5-turbo
    # .model gpt-3.5-turbo-16k
    
    
    When you set up a prompt, every message sent later will carry the prompt.
    .prompt I want you to translate the sentences I write into emojis. I will write the sentence, and you will express it with emojis. I just want you to express it with emojis. I want you to reply only with emojis.
    
    
    # How to give multi-line prompts
    # Simply enclose your prompt in { } or ( ).
    
    # or
    
    .conversation            Start a conversation.
    
    # type here / conversation with context
    
    .clear conversation      End current conversation.
    
    
    
     

    role

    
    # use role
    # https://github.com/sigoden/aichat/wiki/Role-Guide#role-structure
    vi /Users/tbh9527/Library/Application\ Support/aichat/roles.yaml
    - name: shell
       prompt: >
         I want you to act as a Linux shell expert.
         I want you to answer with bash code with explanation as much as possible
    - name: convert:json:yaml
      prompt: convert __ARG1__ below to __ARG2__
    - name: translator:chinese
      prompt: >
        You will act as a translator between english and __ARG1__.
        Whenever you receive a prompt in either language, you will translate the text into the opposite language and provide the translated output as your response.
        Please ensure that your response contains only the translated text and pronounciation in a separate lines if necessary, such as in Japanese using Hiragana.
        No additional descriptions or explanations, No tags or comments to indicate language direction.
    
    
    
    
    
    .role shell
    .role translator:japanese
    
    aichat -r convert:json:yaml
    # the prompt will be
    # convert yaml below to toml
    
    aichat -r translator:japanese ""
    echo "" | aichat -r translator:spanish

    © Ying Bun 2021 - 2024