mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
new ollama test
This commit is contained in:
parent
35bb6f5a50
commit
cf97a9441a
1 changed files with 40 additions and 0 deletions
|
|
@ -49,3 +49,43 @@
|
|||
# pytest.fail(f"Error occurred: {e}")
|
||||
|
||||
# # test_completion_ollama_stream()
|
||||
|
||||
|
||||
# def prepare_messages_for_chat(text: str) -> list:
|
||||
# messages = [
|
||||
# {"role": "user", "content": text},
|
||||
# ]
|
||||
# return messages
|
||||
|
||||
|
||||
# async def ask_question():
|
||||
# params = {
|
||||
# "messages": prepare_messages_for_chat("What is litellm? tell me 10 things about it who is sihaan.write an essay"),
|
||||
# "api_base": "http://localhost:11434",
|
||||
# # "custom_llm_provider": "ollama",
|
||||
# "model": "ollama/llama2",
|
||||
# # "model": "gpt-3.5-turbo",
|
||||
# # "api_key": os.environ["OPENAI_API_KEY"],
|
||||
# "stream": True,
|
||||
# }
|
||||
# # response = litellm.completion(**params, max_tokens=10)
|
||||
# # print(response)
|
||||
# # for c in response:
|
||||
# # print(c)
|
||||
# response = await litellm.acompletion(**params)
|
||||
# print(response)
|
||||
# return response
|
||||
|
||||
|
||||
# async def main():
|
||||
# response = await ask_question()
|
||||
# print(response)
|
||||
|
||||
# async for chunk in response:
|
||||
# print(chunk)
|
||||
|
||||
|
||||
# if __name__ == "__main__":
|
||||
# import asyncio
|
||||
|
||||
# asyncio.run(main())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue