mirror of
https://github.com/MIDORIBIN/langchain-gpt4free.git
synced 2024-12-23 19:22:58 +03:00
fix: change import in usage
This commit is contained in:
parent
9d0b4d013e
commit
1bdad4b922
@ -17,7 +17,7 @@ This command will install langchain_g4f.
|
|||||||
Here is an example of how to use langchain_g4f
|
Here is an example of how to use langchain_g4f
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from g4f import Provider, Model
|
from g4f import Provider, models
|
||||||
from langchain.llms.base import LLM
|
from langchain.llms.base import LLM
|
||||||
|
|
||||||
from langchain_g4f import G4FLLM
|
from langchain_g4f import G4FLLM
|
||||||
@ -25,15 +25,15 @@ from langchain_g4f import G4FLLM
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
llm: LLM = G4FLLM(
|
llm: LLM = G4FLLM(
|
||||||
model=Model.gpt_35_turbo,
|
model=models.gpt_35_turbo,
|
||||||
provider=Provider.Aichat,
|
provider=Provider.Aichat,
|
||||||
)
|
)
|
||||||
|
|
||||||
res = llm('hello')
|
res = llm("hello")
|
||||||
print(res) # Hello! How can I assist you today?
|
print(res) # Hello! How can I assist you today?
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user