-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from hjvogel/main
fixed data_writer and MD data framing
- Loading branch information
Showing
9 changed files
with
89 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
from dspygen.modules.gen_keyword_arguments_module import invoke | ||
from dspygen.utils.dspy_tools import init_dspy | ||
|
||
|
||
def main(): | ||
chat("bot: Hello world") | ||
|
||
from dspygen.utils.dspy_tools import init_dspy, init_ol | ||
|
||
def chat(message: str): | ||
response = chat(invoke(chat, f"{message}\nbot:")) | ||
print(response) | ||
# Function to handle the chat logic | ||
print(f"Received message: {message}") | ||
return f"Response to: {message}" | ||
|
||
def invoke_response(message: str): | ||
# Provide the prompt as a formatted string | ||
prompt = f"{message}\nbot:" | ||
print(f"Generated prompt: {prompt}") # Debug statement to check prompt | ||
try: | ||
response = invoke(chat, prompt=prompt) | ||
except ValueError as e: | ||
print(f"Error while invoking: {e}") # Catch and print the error | ||
raise | ||
return response | ||
|
||
def main(): | ||
response = invoke_response("bot: Hello world") | ||
print(response) | ||
|
||
if __name__ == '__main__': | ||
init_dspy() | ||
|
||
init_ol() | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters