Langroid allows developers toSkip Intelligent Body Abstraction, which interacts directly with LLM. The steps are as follows:
- Configure model parameters (e.g., select GPT-4o or local Ollama model);
- initialization
OpenAIGPT
Example; - invocations
chat()
method to send a question and get a response.
Sample code:
llm_config = OpenAIGPTConfig(chat_model=OpenAIChatModel.GPT4o)
model = OpenAIGPT(llm_config)
response = model.chat("中国的首都是哪里?", max_tokens=20)
This method applies toModeling Ability Testmaybesimple question and answer scenarioIt is not necessary to deal with dialog history or task scheduling.
This answer comes from the articleLangroid: Easily Navigating Large Language Models with Multi-Intelligent Body ProgrammingThe