{"id":24469151,"url":"https://github.com/alex-guoba/tbd","last_synced_at":"2025-03-14T13:24:17.040Z","repository":{"id":203861457,"uuid":"710558724","full_name":"alex-guoba/tbd","owner":"alex-guoba","description":"A command-line productivity tool powered by Baidu Qianfan.基于文心千帆的命令行工具。","archived":false,"fork":false,"pushed_at":"2023-10-30T23:50:35.000Z","size":52,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T07:14:24.460Z","etag":null,"topics":["memos","wenxinqianfan","wenxinworkshop","wenxinyiyan"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alex-guoba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-27T00:26:51.000Z","updated_at":"2024-03-29T12:46:55.000Z","dependencies_parsed_at":"2024-06-19T18:43:44.713Z","dependency_job_id":"85805429-6735-4b58-a4bb-a2bf4bdc08db","html_url":"https://github.com/alex-guoba/tbd","commit_stats":null,"previous_names":["alex-guoba/tbd"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-guoba%2Ftbd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-guoba%2Ftbd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-guoba%2Ftbd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-guoba%2Ftbd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alex-guoba","download_url":"https://codeload.github.com/alex-guoba/tbd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243581828,"owners_count":20314307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["memos","wenxinqianfan","wenxinworkshop","wenxinyiyan"],"created_at":"2025-01-21T07:14:26.645Z","updated_at":"2025-03-14T13:24:17.014Z","avatar_url":"https://github.com/alex-guoba.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tbd\nA command-line productivity tool powered by Baidu Qianfan.\n\nEnglish | [简体中文](./README.zh-CN.md)\n\n## Installation\n\n```shell\ngo install\ncp ./config.yaml $HOME/.config/tgb/\n```\n\nYou'll need an API Key and Secret Key. \n\n1. Create application on here: https://console.bce.baidu.com/qianfan/ais/console/applicationConsole/application\n2. Retrive API Key and Secret Key from the website after application approved.\n\nSet the API Key and Secret Key in `config.yaml` stored in `./`, `$HOME/.config/tgb/` or `/etc/tgb/`.\n\n## Usage\n`tbd` has a variety of use cases, including simple queries, summerization and analyzing.\n\n### Simple queries\nWe can use it as normal search engine, asking about anything:\n\n```shell\n » tbd chat \"How to install python\"\nTo install Python on your computer, follow these steps:\n\n1. Go to the Python website ([python.org](http://python.org)) and download the latest version of Python that matches your operating system.\n2. Run the installer and follow the instructions. Make sure to select the option to add Python to your system path during the installation process.\n3. After the installation is complete, open a command prompt or terminal window and type \"python\" to verify that Python has been successfully installed.\n\nIf you have any issues with the installation, you can refer to the Python documentation or seek help from the Python community.\n```\n\nAlso in chinese: \n\n```shell\n» tbd chat \"今天深圳天气怎样？\"\n# -\u003e 深圳现在气温26℃，多云，东北风3级，2023年10月30日（今日）气温22~29℃，空气质量优，空气质量指数55。\n```\n\n### Summerization and analyzing\n\n`tbd` accepts prompt from both stdin and command line argument. This versatile feature is particularly useful when you need to pass file content or pipe output from other commands to the Baidu Qianfan models for summarization or analysis. For example, you can easily diagnostic local network condition:\n\nHere is a summerization example: \n\n```shell\n » cat ./README.md | tbd chat \"Briefly summarize the functions of tbd tools from README file, keep it to 40 words or less\"\n# -\u003e BD is a command-line productivity tool powered by Baidu Qianfan, used for simple queries, summaries, and analysis. It accepts prompts from stdin and command-line arguments, offering versatility in usage scenarios. The tool also supports multi-round conversations and syncing conversation messages to external systems.\n```\n\nAnalyzing example:\n\n```shell\n » ping -t 2 cloud.baidu.com | tbd chat \"diagnostic network condition from the Ping result\"\n# -\u003e Based on the provided ping results, we can make the following diagnosis of the network condition:\n# -\u003e 1. **Connectivity**: From the results, you have successfully pinged `bce.baidu.n.shifen.com` with no packet loss (0%!p(MISSING)acket loss). This indicates that the connection between your computer and the server is stable.\n# -\u003e 2. **Latency**: The minimum/average/maximum/standard deviation round-trip latency is: 11.511/11.809/12.107/0.298 ms. These values represent the response time between your computer and the server. Generally, lower latency indicates better network performance. Your latency values are relatively low, indicating good network connectivity.\n# -\u003e In summary, based on this ping result, the network connection between your computer and the `bce.baidu.n.shifen.com` server is stable, and latency is low. If you encounter issues using the server or accessing related applications, the problem may not lie with the network connection but with other factors such as issues with the application server itself or software problems.\n```\n\n\n### Interactive mode\n\nTBD supports multi-round conversations, which can be used for complex tasks or clarifying questions if the user's initial question is not clear or specific enough. Use the `-i` or `--interact` parameter to enter interactive mode. Type `exit` to exit the conversation:\n\n```shell\n» tbd chat -i\nplease remember my favorite number: 9\n# -\u003e Of course, I will remember your favorite number as 9. Is there anything else I can assist you with?\nwhat would be my favorite number + 4?\n# -\u003e Your favorite number is 9, so adding 4 to it would result in 13. Therefore, your favorite number plus 4 would be 13.\nexit\n```\n\n### Sync \n\n`tbd` support syning dialog message (request \u0026 response) to external system. like memos. See `config.yaml` for more detail.\n\n## Reference\n\n- [How to write prompt](https://console.bce.baidu.com/qianfan/prompt/template)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex-guoba%2Ftbd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falex-guoba%2Ftbd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex-guoba%2Ftbd/lists"}