This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update tests with azure config (#222)
* update github actions with azure * update tests config with azure * update tests autofastapi with azure * update tests autolitellm with azure * update tests autoqueryengine with azure * update tests autoservicecontext with azure * update tests autoVSindex with azure
- Loading branch information
1 parent
4af1ce8
commit a104237
Showing
8 changed files
with
144 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,17 @@ | ||
from llama_index import Document, ServiceContext, VectorStoreIndex | ||
from llama_index.llms import ChatMessage, ChatResponse | ||
from llama_index.llms.base import BaseLLM | ||
from llama_index.query_engine import BaseQueryEngine | ||
|
||
from autollm.auto.llm import AutoLiteLLM | ||
|
||
|
||
def test_auto_lite_llm(): | ||
document = Document.example() | ||
|
||
llm = AutoLiteLLM.from_defaults(model="gpt-3.5-turbo") | ||
llm = AutoLiteLLM.from_defaults(model="azure/gpt-35-turbo-1106") | ||
|
||
# Check if the llm is an instance of LLM | ||
assert isinstance(llm, BaseLLM) | ||
|
||
service_context = ServiceContext.from_defaults(llm=llm) | ||
|
||
index = VectorStoreIndex.from_documents(documents=[document], service_context=service_context) | ||
|
||
query_engine = index.as_query_engine() | ||
message = ChatMessage(role="user", content="Hey! how's it going?") | ||
chat_response = llm.chat([message]) | ||
|
||
# Check if the query_engine is an instance of BaseQueryEngine | ||
assert isinstance(query_engine, BaseQueryEngine) | ||
# Check if the chat response is an instance of ChatResponse | ||
assert isinstance(chat_response, ChatResponse) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters