Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update OpenAIInstrumentor to support openai>=1.0.0 and deprecate support for openai<1.0.0 #1723

Merged
merged 10 commits into from
Nov 10, 2023

Conversation

axiomofjoy
Copy link
Contributor

@axiomofjoy axiomofjoy commented Nov 9, 2023

  • updates OpenAIInstrumentor to support openai>=1.0.0
  • deprecates support for openai<1.0.0
  • improves test fixtures to instantiate client from reloaded modules (necessary since the originally imported modules are patched by OpenAIInstrumentor.instrument)
  • updates structured data extraction tutorial notebook and pins openai>=1.0.0

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@axiomofjoy axiomofjoy changed the base branch from main to open-ai-1 November 9, 2023 07:25
@axiomofjoy axiomofjoy changed the title fix: update OpenAIInstrumentor to support openai>=1.0.0 feat: update OpenAIInstrumentor to support openai>=1.0.0 and deprecate support for openai<1.0.0 Nov 9, 2023
@axiomofjoy axiomofjoy linked an issue Nov 9, 2023 that may be closed by this pull request
4 tasks
Copy link
Contributor

@anticorrelator anticorrelator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @axiomofjoy this looks great, though just FYI I've changed all of the tests that rely on responses to use respx in @mikeldking's compatibility branch, maybe we can change the merge target to that branch to resolve the conflicts?

Copy link
Contributor

@mikeldking mikeldking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@axiomofjoy
Copy link
Contributor Author

Hey @axiomofjoy this looks great, though just FYI I've changed all of the tests that rely on responses to use respx in @mikeldking's compatibility branch, maybe we can change the merge target to that branch to resolve the conflicts?

Hey @anticorrelator, which branch do you want me to target?

@axiomofjoy axiomofjoy merged commit 3ae4837 into open-ai-1 Nov 10, 2023
@axiomofjoy axiomofjoy deleted the openai-instrumentor-v1 branch November 10, 2023 05:01
mikeldking added a commit that referenced this pull request Nov 10, 2023
* git output via openai migrate

* WIP

* git output via openai migrate

WIP

* get pytests running

* get pytests running

* completions changes

* fix llm_classify tests

* fix llm generate tests

* minimal test for openai

* fix llama_index tests

* add back model

* fix openai

* fix openai tests

* Add explanations section for relevance

* run GPT4-Turbo

* update notebooks

* migrate find clusters notebook

* update more notebooks

* fix relevance

* fix tutorials/llm_generative_gpt_4.ipynb

* add more tutorials

* Start refactoring httpx tests to be order-agnostic

* Finish refactoring classification tests

* Refactor `generate` tests to be order-agnostic

* Migrate to respx for langchain tracer tests

* Update openai tracing tests to use respx

* feat(evals): azure openai support

* address pr comments

* return early  for azure

* fix tiktoken failures

* remove model name aliasing

* make gpt-4 point to latest

* ruff format

* docs: update documentation

* feat: update OpenAIInstrumentor to support openai>=1.0.0 and deprecate support for openai<1.0.0 (#1723)

* correct unit test to mock completions endpoint (#1730)

* Update langchain_pinecone_search_and_retrieval_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update llama_index_search_and_retrieval_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update llm_generative_gpt_4.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update milvus_llamaindex_search_and_retrieval_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update ragas_retrieval_evals_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update langchain_agent_tracing_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update langchain_tracing_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update llama_index_openai_agent_tracing_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update llama_index_tracing_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update langchain_retrieval_qa_with_sources_chain_tracing_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update find_cluster_export_and_explore_with_gpt.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update evaluate_toxicity_classifications.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update evaluate_summarization_classifications.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update evaluate_QA_classifications.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update evaluate_hallucination_classifications.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update evaluate_code_readability_classifications.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* document breaking changes, bump langchain

* add more details to the breaking changes

* langchain bump

* fix qa evals notebook

* fix style

* update major version

* remove logging token count warnings

---------

Co-authored-by: Dustin Ngo <dustin@arize.com>
Co-authored-by: Xander Song <axiomofjoy@gmail.com>
mikeldking added a commit that referenced this pull request Nov 13, 2023
* git output via openai migrate

* WIP

* git output via openai migrate

WIP

* get pytests running

* get pytests running

* completions changes

* fix llm_classify tests

* fix llm generate tests

* minimal test for openai

* fix llama_index tests

* add back model

* fix openai

* fix openai tests

* Add explanations section for relevance

* run GPT4-Turbo

* update notebooks

* migrate find clusters notebook

* update more notebooks

* fix relevance

* fix tutorials/llm_generative_gpt_4.ipynb

* add more tutorials

* Start refactoring httpx tests to be order-agnostic

* Finish refactoring classification tests

* Refactor `generate` tests to be order-agnostic

* Migrate to respx for langchain tracer tests

* Update openai tracing tests to use respx

* feat(evals): azure openai support

* address pr comments

* return early  for azure

* fix tiktoken failures

* remove model name aliasing

* make gpt-4 point to latest

* ruff format

* docs: update documentation

* feat: update OpenAIInstrumentor to support openai>=1.0.0 and deprecate support for openai<1.0.0 (#1723)

* correct unit test to mock completions endpoint (#1730)

* Update langchain_pinecone_search_and_retrieval_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update llama_index_search_and_retrieval_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update llm_generative_gpt_4.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update milvus_llamaindex_search_and_retrieval_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update ragas_retrieval_evals_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update langchain_agent_tracing_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update langchain_tracing_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update llama_index_openai_agent_tracing_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update llama_index_tracing_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update langchain_retrieval_qa_with_sources_chain_tracing_tutorial.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update find_cluster_export_and_explore_with_gpt.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update evaluate_toxicity_classifications.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update evaluate_summarization_classifications.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update evaluate_QA_classifications.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update evaluate_hallucination_classifications.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* Update evaluate_code_readability_classifications.ipynb

Co-authored-by: Xander Song <axiomofjoy@gmail.com>

* document breaking changes, bump langchain

* add more details to the breaking changes

* langchain bump

* fix qa evals notebook

* fix style

* update major version

* remove logging token count warnings

---------

Co-authored-by: Dustin Ngo <dustin@arize.com>
Co-authored-by: Xander Song <axiomofjoy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Support OpenAI 1.0
3 participants