langroid 0.50.9__py3-none-any.whl → 0.50.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -733,16 +733,37 @@ class LanguageModel(ABC):
733
733
  history = collate_chat_history(chat_history)
734
734
 
735
735
  prompt = f"""
736
- Given the CHAT HISTORY below, and a follow-up QUESTION or SEARCH PHRASE,
737
- rephrase the follow-up question/phrase as a STANDALONE QUESTION that
738
- can be understood without the context of the chat history.
736
+ You are an expert at understanding a CHAT HISTORY between an AI Assistant
737
+ and a User, and you are highly skilled in rephrasing the User's FOLLOW-UP
738
+ QUESTION/REQUEST as a STANDALONE QUESTION/REQUEST that can be understood
739
+ WITHOUT the context of the chat history.
739
740
 
740
- Chat history: {history}
741
+ Below is the CHAT HISTORY. When the User asks you to rephrase a
742
+ FOLLOW-UP QUESTION/REQUEST, your ONLY task is to simply return the
743
+ question REPHRASED as a STANDALONE QUESTION/REQUEST, without any additional
744
+ text or context.
741
745
 
742
- Follow-up question: {question}
746
+ <CHAT_HISTORY>
747
+ {history}
748
+ </CHAT_HISTORY>
743
749
  """.strip()
750
+
751
+ follow_up_question = f"""
752
+ Please rephrase this as a stand-alone question or request:
753
+ <FOLLOW-UP-QUESTION-OR-REQUEST>
754
+ {question}
755
+ </FOLLOW-UP-QUESTION-OR-REQUEST>
756
+ """.strip()
757
+
744
758
  show_if_debug(prompt, "FOLLOWUP->STANDALONE-PROMPT= ")
745
- standalone = self.generate(prompt=prompt, max_tokens=1024).message.strip()
759
+ standalone = self.chat(
760
+ messages=[
761
+ LLMMessage(role=Role.SYSTEM, content=prompt),
762
+ LLMMessage(role=Role.USER, content=follow_up_question),
763
+ ],
764
+ max_tokens=1024,
765
+ ).message.strip()
766
+
746
767
  show_if_debug(prompt, "FOLLOWUP->STANDALONE-RESPONSE= ")
747
768
  return standalone
748
769
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langroid
3
- Version: 0.50.9
3
+ Version: 0.50.10
4
4
  Summary: Harness LLMs with Multi-Agent Programming
5
5
  Author-email: Prasad Chalasani <pchalasani@gmail.com>
6
6
  License: MIT
@@ -69,7 +69,7 @@ langroid/embedding_models/protoc/embeddings_pb2.pyi,sha256=UkNy7BrNsmQm0vLb3NtGX
69
69
  langroid/embedding_models/protoc/embeddings_pb2_grpc.py,sha256=9dYQqkW3JPyBpSEjeGXTNpSqAkC-6FPtBHyteVob2Y8,2452
70
70
  langroid/language_models/__init__.py,sha256=3aD2qC1lz8v12HX4B-dilv27gNxYdGdeu1QvDlkqqHs,1095
71
71
  langroid/language_models/azure_openai.py,sha256=SW0Fp_y6HpERr9l6TtF6CYsKgKwjUf_hSL_2mhTV4wI,5034
72
- langroid/language_models/base.py,sha256=A9A83SJOGh_elRScKNIDAcVT4mw9vKCou7txsPMVSv4,27023
72
+ langroid/language_models/base.py,sha256=sCDC02hqIgjY73KnCvc-YGxZJm_LAs4Z1VVQpIFWLyQ,27754
73
73
  langroid/language_models/config.py,sha256=9Q8wk5a7RQr8LGMT_0WkpjY8S4ywK06SalVRjXlfCiI,378
74
74
  langroid/language_models/mock_lm.py,sha256=5BgHKDVRWFbUwDT_PFgTZXz9-k8wJSA2e3PZmyDgQ1k,4022
75
75
  langroid/language_models/model_info.py,sha256=tfBBxL0iUf2mVN6CjcvqflzFUVg2oZqOJZexZ8jHTYA,12216
@@ -129,7 +129,7 @@ langroid/vector_store/pineconedb.py,sha256=otxXZNaBKb9f_H75HTaU3lMHiaR2NUp5MqwLZ
129
129
  langroid/vector_store/postgres.py,sha256=wHPtIi2qM4fhO4pMQr95pz1ZCe7dTb2hxl4VYspGZoA,16104
130
130
  langroid/vector_store/qdrantdb.py,sha256=O6dSBoDZ0jzfeVBd7LLvsXu083xs2fxXtPa9gGX3JX4,18443
131
131
  langroid/vector_store/weaviatedb.py,sha256=Yn8pg139gOy3zkaPfoTbMXEEBCiLiYa1MU5d_3UA1K4,11847
132
- langroid-0.50.9.dist-info/METADATA,sha256=51zKXzdMlaWzOJAcz-8zmz78Kmqj_lXmEQ03LnMSOgc,63641
133
- langroid-0.50.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
134
- langroid-0.50.9.dist-info/licenses/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
135
- langroid-0.50.9.dist-info/RECORD,,
132
+ langroid-0.50.10.dist-info/METADATA,sha256=XAXiPJuTaCrL_WyihMNOfVxm1BZxk_aAxxg_OCQSQqQ,63642
133
+ langroid-0.50.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
134
+ langroid-0.50.10.dist-info/licenses/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
135
+ langroid-0.50.10.dist-info/RECORD,,