0
0
mirror of https://github.com/MIDORIBIN/langchain-gpt4free.git synced 2025-01-11 10:48:09 +03:00
langchain-gpt4free/sample/llm_sample.py

19 lines
332 B
Python
Raw Normal View History

from g4f import Provider, models
2023-07-08 11:37:54 +03:00
from langchain.llms.base import LLM
from langchain_g4f import G4FLLM
def main():
llm: LLM = G4FLLM(
model=models.gpt_35_turbo,
2023-07-08 11:37:54 +03:00
provider=Provider.Aichat,
)
2023-07-23 04:20:03 +03:00
res = llm("hello")
2023-07-08 11:37:54 +03:00
print(res) # Hello! How can I assist you today?
2023-07-23 04:20:03 +03:00
if __name__ == "__main__":
2023-07-08 11:37:54 +03:00
main()