euroargodev / argopy

A python library for Argo data beginners and experts
https://argopy.readthedocs.io
European Union Public License 1.2
176 stars 39 forks source link

AI Argo/Python assistant based on OpenAI chat-GPT-v3.5 #282

Open gmaze opened 1 year ago

gmaze commented 1 year ago

Let's have some fun with this new feature, a virtual assistant based on chatGPT

full disclosure: this is primarily made just for fun and to explore possibilities with the openai library

Requirements

Usage

Create an assistant instance:

import argopy
argopy.set_options(openai_api_key='*****', user='Jane')  # https://platform.openai.com/account/api-keys

AI = Assistant()
    <argopy.Assistant>
    You're up to start chatting or asking questions to 🤖 Medea, your Argo assistant
    Initiate a chat session with the: chat() method
    or just ask a question with the: ask('text') method
    Check out your API usage at: https://platform.openai.com/account/usage

    ❗❗This is an highly experimental feature, mainly built just for fun ❗❗
    Use at your own risk and be aware that chatGPT often tends to invent non-existing argopy methods
    The argopy documentation is the most reliable source of information: https://argopy.readthedocs.io/

then, you can ask one question:

AI.ask('how to load float 6903456 ?')
AI.ask('show me how to load the Argo profile index with argopy')

or trigger an interactive chat session:

AI.chat()

in the end, you can still check out your conversation with the assistant:

AI.replay()

The Assistant should adapt responses to your user mode:

with argopy.set_options(mode='expert'):
    Assistant().chat()
with argopy.set_options(mode='standard'):
    Assistant().chat()

Motivations

Fun !

Seriously: the Argo community report more than 20 pdf manuals, some with 10s of pages, hundreds of variables and so on... Given what's now and easily possible with python librairies, it should be possible to make a chat bot that could seriously help beginners with Argo data.

github-actions[bot] commented 11 months ago

This pull request was marked as staled automatically because it has not seen any activity in 90 days

github-actions[bot] commented 1 day ago

This pull request was marked as staled automatically because it has not seen any activity in 90 days