semvec/pypi-packages huggingface dataset:
ChatGPTDevFriendly 0.0.111
A wrapper package which takes care of API call robustness to ensure developers quickly and easily develop CHatGPT based applications.
Requires Python: >=3.7

# ChatGPTDevFriendly


This package can be used by developers to quickly develop ChatGPT applications with the robustness 
and boilerplate code being taken care of by this wrapper.

## Requirements 
`pip install openai`

## Usage 

All the source code is currently in `src` directory and also in `tests` with sample usage in `test_main.py`. You will need an [OpenAI key](https://platform.openai.com/account/api-keys
) to use this. 

```python
chatgpt_client = ChatGptSmartClient(openai_api_key, model_name)
# We can query with some previous context and also decide whether to add a prompts answer to the context
prompt="List the top 10 upcoming startups in India?"
response, response_id = chatgpt_client.query(prompt, w_context=True, add_to_context=True)
print(f"The answer from ChatGPT is {response}")

# We build on previous context but do not add the current prompts answer to context
prompt="Ok thanks, can you give me the valuation of these startups in tabular format"
response  = chatgpt_client.query(prompt, w_context=True, add_to_context=False)
...

```

## Features


- [x] Save Conversations to a file
- [x] Resume conversations by loading context from a file. 
- [x] Retry logic in case of API failures.
- [x] Regular Trimming of context to 4000 tokens so that limit of 4097 is not breached. 
- [x] Total token and token vs time metric. 


- Retries: This is incase of failures like connection based request exceptions, API errors.
```
    (openai) C:\Users\Srinivas\OneDrive\Desktop\StartupSearchGPT\tests>python test_main.py
    Error occurred: API error , please try later
    Retrying after 3 seconds...
    Error occurred: API error , please try later
    Retrying after 6 seconds...
    Error occurred: API error , please try later
    Retrying after 12 seconds...
    Error occurred: API error , please try later
``` 
- Context trimming: Context is trimmed as needed when the limit breaches 4000 tokens. 
![Trimming and printing metrics](printed_metrics.png)

- Tracking metrics such as average time per response and total token usage.
```
    04-10-2023 10:26:44 | INFO | The time taken for this response is : 7.85 seconds

    04-10-2023 10:34:34 | INFO | The total tokens used up-till now is: 665
    04-10-2023 10:34:34 | INFO | The average response time is: 10.28 sec
```
![Sample response times graph](response_times.png)

```python
    chatgpt_client.print_metrics()
```
- Erasing Context: We can erase all previous chat history to star from fresh.
```python
    chatgpt_client.erase_history()
```
- Rollback: we can rollback to a particular Chatresponse context to an restart from there.
```python
    chatgpt_client.rollback_conversation(response_id)
```

- Embeddings: We can get the query embeddings and cache them for further use. (In developement)
```python
    chatgpt_client.get_embeddings()
```

## Contributions

This project is meant to make the chatgpt developer life easy, so please do add any featues you feel is needed! Also if you fnd it useful please leave a star!!
welltestpy 1.2.0
welltestpy - package to handle well-based Field-campaigns.
Requires Python: >=3.7

# Welcome to welltestpy

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1229051.svg)](https://doi.org/10.5281/zenodo.1229051)
[![PyPI version](https://badge.fury.io/py/welltestpy.svg)](https://badge.fury.io/py/welltestpy)
[![Build Status](https://github.com/GeoStat-Framework/welltestpy/workflows/Continuous%20Integration/badge.svg?branch=main)](https://github.com/GeoStat-Framework/welltestpy/actions)
[![Coverage Status](https://coveralls.io/repos/github/GeoStat-Framework/welltestpy/badge.svg?branch=main)](https://coveralls.io/github/GeoStat-Framework/welltestpy?branch=main)
[![Documentation Status](https://readthedocs.org/projects/welltestpy/badge/?version=latest)](https://geostat-framework.readthedocs.io/projects/welltestpy/en/latest/?badge=latest)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

<p align="center">
<img src="https://raw.githubusercontent.com/GeoStat-Framework/welltestpy/main/docs/source/pics/WTP.png" alt="welltestpy-LOGO" width="251px"/>
</p>

## Purpose

welltestpy provides a framework to handle, process, plot and analyse data from well based field campaigns.


## Installation

You can install the latest version with the following command:

    pip install welltestpy

Or from conda

    conda install -c conda-forge welltestpy


## Documentation for welltestpy

You can find the documentation including tutorials and examples under
https://welltestpy.readthedocs.io.


## Citing welltestpy

If you are using this package you can cite our
[Groundwater publication](https://doi.org/10.1111/gwat.13121) by:

> Müller, S., Leven, C., Dietrich, P., Attinger, S. and Zech, A. (2021):
> How to Find Aquifer Statistics Utilizing Pumping Tests? Two Field Studies Using welltestpy.
> Groundwater, https://doi.org/10.1111/gwat.13121

To cite the code, please visit the [Zenodo page](https://doi.org/10.5281/zenodo.1229051).


## Provided Subpackages

```python
welltestpy.data      # Subpackage to handle data from field campaigns
welltestpy.estimate  # Subpackage to estimate field parameters
welltestpy.process   # Subpackage to pre- and post-process data
welltestpy.tools     # Subpackage with tools for plotting and triagulation
```


## Requirements

- [NumPy >= 1.14.5](https://www.numpy.org)
- [SciPy >= 1.1.0](https://www.scipy.org)
- [AnaFlow >= 1.0.0](https://github.com/GeoStat-Framework/AnaFlow)
- [SpotPy >= 1.5.0](https://github.com/thouska/spotpy)
- [Matplotlib >= 3.0.0](https://matplotlib.org)


## Contact

You can contact us via <info@geostat-framework.org>.


## License

[MIT](https://github.com/GeoStat-Framework/welltestpy/blob/main/LICENSE)