mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-07-06 21:11:37 +08:00
feat: add forcing format as json
This commit is contained in:
parent
38d138e36f
commit
5cfc10178a
@ -27,7 +27,6 @@ graph_config = {
|
||||
"llm": {
|
||||
"model": "ollama/llama3",
|
||||
"temperature": 0,
|
||||
"format": "json", # Ollama needs the format to be specified explicitly
|
||||
# "model_tokens": 2000, # set context length arbitrarily
|
||||
"base_url": "http://localhost:11434",
|
||||
},
|
||||
|
||||
@ -59,6 +59,7 @@ class GenerateAnswerCSVNode(BaseNode):
|
||||
"""
|
||||
super().__init__(node_name, "node", input, output, 2, node_config)
|
||||
self.llm_model = node_config["llm_model"]
|
||||
self.llm_model.format="json"
|
||||
self.verbose = (
|
||||
False if node_config is None else node_config.get("verbose", False)
|
||||
)
|
||||
|
||||
@ -44,8 +44,8 @@ class GenerateAnswerNode(BaseNode):
|
||||
node_name: str = "GenerateAnswer",
|
||||
):
|
||||
super().__init__(node_name, "node", input, output, 2, node_config)
|
||||
|
||||
self.llm_model = node_config["llm_model"]
|
||||
self.llm_model.format="json"
|
||||
self.verbose = (
|
||||
True if node_config is None else node_config.get("verbose", False)
|
||||
)
|
||||
|
||||
@ -44,6 +44,7 @@ class GenerateAnswerOmniNode(BaseNode):
|
||||
super().__init__(node_name, "node", input, output, 3, node_config)
|
||||
|
||||
self.llm_model = node_config["llm_model"]
|
||||
self.llm_model.format="json"
|
||||
self.verbose = (
|
||||
False if node_config is None else node_config.get("verbose", False)
|
||||
)
|
||||
|
||||
@ -58,6 +58,7 @@ class GenerateAnswerPDFNode(BaseNode):
|
||||
"""
|
||||
super().__init__(node_name, "node", input, output, 2, node_config)
|
||||
self.llm_model = node_config["llm_model"]
|
||||
self.llm_model.format="json"
|
||||
self.verbose = (
|
||||
False if node_config is None else node_config.get("verbose", False)
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user