Skip to content

Commit

Permalink
add pip install
Browse files Browse the repository at this point in the history
  • Loading branch information
yanqingmen committed Mar 17, 2023
1 parent 0d3bc5a commit 69926aa
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 11 deletions.
5 changes: 3 additions & 2 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ ask-api is a python framework, based on the llm models, which can help you to un
- using natural language to describe the exceptions and errors.
- Other free dialogue with the function.

#### Installation (to be improved)
#### Installation
```shell
pip install ask-api
```

#### Development plan (in progress)

- [x] Based on openai's chatgpt-api, support asking questions about python functions to understand the function.
- [X] Support Chinese and English prompts.
- [ ] Install via pip.
- [X] Install via pip.
- [ ] Support custom prompts.
- [X] Support executing functions by natural language commands.
- [ ] Support other llm models or apis as the underlying algorithm support
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ ask-api 是一个python框架,借助LLM(目前支持chatgpt-api)模型的代
- 将操作过程中的各种异常信息,通过自然语言的方式告知用户。
- 与函数进行其他自由对话。

#### 安装(待完善)
#### 安装
```shell
pip install ask-api
```

#### 开发计划(进行中)

- [x] 基于openai的chatgpt-api,支持对python函数进行提问,了解函数的用途。
- [X] 支持中文以及英文两种类型的prompt。
- [ ] 通过pip安装。
- [X] 通过pip安装。
- [ ] 支持自定义的prompt。
- [X] 支持通过自然语言命令来执行函数。
- [ ] 支持其他LLM模型或api作为底层算法支持
Expand Down
23 changes: 16 additions & 7 deletions examples/zh_askapi_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@
"name": "stderr",
"output_type": "stream",
"text": [
"2023-03-09 00:18:03,005 - ask_api.py[line:24] - INFO: create function role for: download_data\n"
"2023-03-13 15:35:05,774 - ask_api.py[line:24] - INFO: create function role for: download_data\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"****************************************************************************************************\n",
"download_data: 你好,我是download_data函数,我能够帮助你下载指定url的数据并保存至指定目录,如果需要我的帮助,请告诉我要下载的url和保存至的目录路径\n"
"download_data: 你好,我是download_data,我能够帮助你下载数据并保存至指定目录,如果需要我的帮助,请告诉我数据的url和保存目录\n"
]
}
],
Expand Down Expand Up @@ -173,9 +173,13 @@
"from ask_api.util.askapi_asyn import wait_task\n",
"\n",
"task = session.get_current().get_task()\n",
"result_message = wait_task(task)\n",
"\n",
"print(result_message)"
"if task is None:\n",
" print(\"task is complete!\")\n",
" print(session.get_current())\n",
"else:\n",
" print(\"task is running\")\n",
" result = wait_task(task)\n",
" print(result)"
],
"metadata": {
"collapsed": false
Expand Down Expand Up @@ -232,8 +236,13 @@
"print(session.get_current())\n",
"print(\"*\" * 100)\n",
"task = session.get_current().get_task()\n",
"result_message = wait_task(task)\n",
"print(result_message)"
"if task is None:\n",
" print(\"task is complete!\")\n",
" print(session.get_current())\n",
"else:\n",
" print(\"task is running\")\n",
" result = wait_task(task)\n",
" print(result)"
],
"metadata": {
"collapsed": false
Expand Down
Binary file modified requirements.txt
Binary file not shown.
Empty file added setup.cfg
Empty file.
25 changes: 25 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages

with open('README.md', encoding='utf-8') as f:
long_description = f.read()

with open('requirements.txt', encoding='utf-8') as f:
requirements = f.read().strip().split('\n')

pkgs = find_packages(where='src')
print(pkgs)

setup(
name='ask-api',
version='0.1.0',
url='https://github.com/yanqingmen/ask-api',
license="Apache License 2.0",
long_description=long_description,
long_description_content_type='text/markdown',
author='yanqingmen',
python_requires='>=3.7',
install_requires=requirements,
package_dir={"": "src"},
packages=pkgs,
)

0 comments on commit 69926aa

Please sign in to comment.