Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove chatml validation from sdk #127

Merged
merged 6 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions agentops/langchain_callback_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ async def on_llm_end(
# TODO: more descriptive error
error_event = ErrorEvent(trigger_event=self.events.llm[str(run_id)],
details="on_llm_end: No generations", timestamp=get_ISO_time())
details="on_llm_end: No generations", timestamp=get_ISO_time())
HowieG marked this conversation as resolved.
Show resolved Hide resolved
self.ao_client.record(error_event)

@debug_print_function_params
Expand Down
4 changes: 2 additions & 2 deletions agentops/llm_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def generator():
self.llm_event.agent_id = check_call_stack_for_agent_id()
self.llm_event.prompt = kwargs["messages"]
self.llm_event.prompt_tokens = response['usage']['prompt_tokens']
self.llm_event.completion = response['choices'][0]['message']['content']
self.llm_event.completion = {"role": "assistant", "content": response['choices'][0]['message']['content']}
self.llm_event.completion_tokens = response['usage']['completion_tokens']
self.llm_event.returns = {"content": response['choices'][0]['message']['content']}
self.llm_event.model = response["model"]
Expand Down Expand Up @@ -181,7 +181,7 @@ async def async_generator():
self.llm_event.agent_id = check_call_stack_for_agent_id()
self.llm_event.prompt = kwargs["messages"]
self.llm_event.prompt_tokens = response.usage.prompt_tokens
self.llm_event.completion = response.choices[0].message.model_dump().get('content')
HowieG marked this conversation as resolved.
Show resolved Hide resolved
self.llm_event.completion = response.choices[0].message.model_dump()
self.llm_event.completion_tokens = response.usage.completion_tokens
self.llm_event.returns = response.model_dump()
self.llm_event.model = response.model
Expand Down
Loading