Open Sandy4321 opened 6 months ago
updated packages today since for old packages not working at all pip install langchain openai --upgrade
I have updated strictjson. Let me modify the code and upload again
great, thanks , pls to it asap
any updates pls
are you going to fix bug pls
is it possible to fix bug s pls
You're in luck! I had some free time today and updated the OpenAI API. The StrictJSON portion was actually working as it was using the old strict_output defined in the notebook.
I have updated it to use the current StrictJSON v4.0.0!
Check it out here: https://github.com/tanchongmin/strictjson/blob/main/Experiments/LLM%20with%20Knowledge%20Graphs.ipynb
great thanks , let me check. only when i installing I get downgrading some packages Installing collected packages: anyio, openai, strictjson Attempting uninstall: anyio Found existing installation: anyio 4.3.0 Uninstalling anyio-4.3.0: Successfully uninstalled anyio-4.3.0 Attempting uninstall: openai Found existing installation: openai 1.14.3 Uninstalling openai-1.14.3: Successfully uninstalled openai-1.14.3 Successfully installed anyio-3.7.1 openai-1.3.6 strictjson-4.0.0
is it what you meant to do ?
did the jupyter notebook work?
LLM with Knowledge Graphs.ipynb
I get error ValueError: too many values to unpack (expected 3) and wrong output for Step 2: Parse Knowledge Graph https://github.com/tanchongmin/TensorFlow-Implementations/blob/main/Tutorial/LLM%20with%20Knowledge%20Graphs.ipynb
and
and
some updates in your code done to meet changes in updated packages def strict_output(system_prompt, user_prompt, output_format, default_category = "", output_value_only = False, model = 'gpt-3.5-turbo', temperature = 0, num_tries = 2, verbose = False): ''' Ensures that OpenAI will always adhere to the desired output json format. Uses rule-based iterative feedback to ask GPT to self-correct. Keeps trying up to num_tries it it does not. Returns empty json if unable to after num_tries iterations. If output field is a list, will treat as a classification problem and output best classification category. Text enclosed within < > will generated by GPT accordingly'''
Do not put quotation marks or escape character \ in the output fields.'''
Any text enclosed by < and > indicates you must generate content to replace it. Example input: Go to, Example output: Go to the garden
Any output key containing < and > indicates you must generate the key name to replace it. Example input: {{'': 'description of location'}}, Example output: {{'school': 'a place for education'}}'''